I am working on customizing the purchase module, in which i need to save the content of the purchase order in a newly created table whenever the purchase order is confirmed. I have developed a module in order to save the content to the table using create function but finally i got some errors. Please any one give some idea how to clear this error
This is the code
class inherit_purchase_update(models.Model):
_inherit='purchase.order'
def wkf_confirm_order(self, cr, uid, ids, context=None):
id1=ids
recs= self.pool.get('purchase.order.line').browse(cr,uid,id1,context=context)
recd= self.pool.get('purchase.update').browse(cr,uid,ids,context=context)
for rec in recs:
cust_id=rec.partner_id.id
price_unit= rec.price_unit
prod_id= rec.product_id.id
date_order=rec.order_id.date_order
prod_qty= rec.product_qty
rec1=recd.create(cr,uid,{'partner_id':cust_id,'date':date_order,'product_id':prod_id,'price_unit':price_unit,'product_qty':prod_qty})
ValueError: "create() takes exactly 2 arguments (4 given)" while evaluating u'wkf_confirm_order()'
plz purchase it immediatly
I got every values but the problem is while inserting into the tables