DEF create (self,cr,uid,vals,context=None):
If contextIsNone:
Context ={}
If Vals.get (' Name ','/') = =‘/‘:
vals[' Name ']=Self.pool.get (' Ir.sequence '). Get (Cr,uid,' Sale.origin ')Or‘/‘
ctx=Dict (contextor {},mail_create_nolog=True)
#If this field is present, do not process and delete this element
Flagline=vals
Print22222222222
# Print Vals
Print Vals.get (' line_id ')
linenum=Len (Vals.get (' line_id '))
New_line_id=[]
# for Loop through all data , then put the satisfying condition data into a new array , re-assigned to output variable ,linenum fixed length
for I in range (linenum):
if ' Choice ' in Vals.get ( line_id ') [I][2] and vals.get ( ' line_id ') [i][ 2] [ Choice '] is true:
# if ' Choice ' is True:
New_line_id.append (Vals.get (' line_id ') [i])
Print11111111111111111
Print new_line_id
vals[' line_id ']=new_line_id
print vals.get ( ' line_id ')
New_id=super (Sale_origin,self). Create (Cr,uid,vals, context=ctx)
######## #zxs beign add followers here depend on od-oa module
Res_model=self._name
Obj= Self.pool.get ( ' Od.oa.add.user ')
Obj.add_follower_ids (cr,uid,res_model,new_id)
return new_id
Python dictionary, tuple, object, array value method