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.
how to update field of parent object? eg: I want to update 'partner_id' field of 'sale.order' on changeing 'product_id' field of 'sale.order.line'. Is that possible?
I tried something like
# it updates fields of same class
self.product_uom_qty = 3232
# but system ignores fields from parent class
self.order_id.partner_id = 1
self.order_id.client_order_ref = 'xyz'
The first question that pops into my mind is: what is the rule if there are more than one lines are changed and each of the line yields different partner_id?
A more appropriate approach, AFAIK, is to put on_change on the order_line (which is the one2many field in sale.order to sale.order.line) and change the partner_id based on all of product_ids in order_line.
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/20/15, 9:13 AM|
|Seen: 657 times|
|Last updated: 3/16/15, 8:10 AM|