Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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)'"
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 1/21/15, 4:46 AM|
|Seen: 2012 times|
|Last updated: 3/16/15, 8:10 AM|