Hi everyone, i have create def create that overrides how the create button behave but it returns an error. Any help is very much appreciate. Here is the chunk of my code.
pr_id = vals.get('purchase_requisition_id')
order_id = self.pool.get('purchase.order').search(cr,user,[('requisition_id','=',pr_id)],context=context)
for purchase_order in self.pool.get('purchase.order').browse(cr,user,order_id):
vals['stocks_ready_received'] = purchase_order.stocks_ready_received
vals['stocks_received'] = purchase_order.stocks_received
. . .
but when vals['stocks_read_received'] = purchase_order.stocks_ready_received is read it pops up an error something like this:
File "/opt/openerp/server-7/openerp/osv/orm.py", line 4469, in create
result += self._columns[field].set(cr, self, id_new, field, vals[field], user, rel_context) or 
File "/opt/openerp/server-7/openerp/osv/fields.py", line 555, in set
if act == 0:
File "/opt/openerp/server-7/openerp/osv/orm.py", line 383, in __getitem__
KeyError: "Field '0' does not exist in object 'browse_record(stock.move, 10)'"
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 1/21/15, 4:46 AM|
|Seen: 1545 times|
|Last updated: 3/16/15, 8:10 AM|