Hi
Below an example to illustrate my issue.
I have two models, model B has a One2many link to model A.
On the model B view, I display the field 'link', and a button that calls function fct()
When the record is in edit mode, I would like the function fct() tu update the var1 field of the linked A record to be changed (without db commit). This does not works: the value is committed to db.
class A(models.Model):
var1 = fields.Char(...)
class B(models.Model):
link = fields.One2many("A", ..)
def fct(self):
for r in self.link:
r.var1 = "new value" # this is not working as expected
Could you please advice ?
Edit: after some tests, the changes are only not committed using @onchange, is there any solution to have the same behavior with buttons ?