Python dictionary, tuple, object, array value method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.