-
Notifications
You must be signed in to change notification settings - Fork 32k
Inverse methods not called in NewId records #13076
Copy link
Copy link
Closed
Labels
Description
Impacted versions: 9
Steps to reproduce:
Create a field with an inverse record, such as:
class BugTest(models.Model):
_name = "bug.test"
something = fields.Char(compute="_compute_something", inverse="_inverse_something")
something_else = fields.Char()
@api.multi
@api.depends("something_else")
def _compute_something(self):
for s in self:
s.something = s.something_else
@api.multi
def _inverse_something(self):
for s in self:
s.something_else = s.something
@api.model
def _test_inverse_new(self):
a = self.new({"something": "Will you find me?"})
if a.something != a.something_else:
raise ValidationError("Bugged!")
Now execute the _test_inverse_new method.
Current behavior: Bugged!
Expected behavior: Should not raise an exception.
Reactions are currently unavailable