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.
I wrote an onchange method that change the state field value based on the value of another field.
|I see that the "state" value change. But when I save the form the state field take the old version.|
|Please How can I resolve this issue. I think this issue is only for state field|
Why do you have @api.multi above the @api.onchange? They should not be combined, you only need the onchange.
As for the value assigning: why don't you simply write on self right away? Your code should look like this:
@api.onchange(lgs) def on_change_state(self): for record in self:
record.state = 'waiting'
record.state = 'draft'
print self.state, self.lgs
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: 5/9/17, 6:00 AM|
|Seen: 2996 times|
|Last updated: 6/19/18, 2:51 AM|