问题描述:

if values['section_id']:

custom_dept=[{'name':name,'complete_name':complete_name,'company_id':company_id,'parent_id':parent_id,'manager_id':manager_id},

{'name':name,'complete_name':complete_name,'company_id':company_id,'parent_id':parent_id,'manager_id':manager_id},

{'name':name,'complete_name':complete_name,'company_id':company_id,'parent_id':parent_id,'manager_id':manager_id}]

department_obj.create(cr, uid, custom_dept, context=context)

i need solution like above.can anyone help me to implement this.?

网友答案:

You can't do this with the create method as that inserts a single record. You could do this with a SQL query but I wouldn't recommend it. Remember that OpenERP wraps everything in a PostgreSQL transaction so your records will all get inserted if you run the create command in a loop.

相关阅读:
Top