Hey guys,
I try to creat a purchase order via XML-RPC.
This is my code:
gid=125 # Id of supplierp
id= 64 # ID of product
models.execute_kw(db, uid, passwrd, 'purchase.order', 'create',
[{'partner_id': gid, 'state':'approves', 'location_id':12,
'order_line':[(0,False,{'product_id':pid,'product_qty':20.0, 'price_unit':2,0})]
}])
The problem is, taht I get the following Error:
>>>
xmlrpclib.Fault: <Fault 2: 'The operation cannot be completed, probably due to the following:\n- deletion: you may be trying to delete a record while other records still reference it\n- creation/update: a mandatory field is not correctly set\n\n[object with reference: pricelist_id - pricelist.id]'>
<<<
In the purchase.py file is pricelist_id set as default.
Does anyone know how to creat a purchase order sucessfull?