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