Browse parent back
When we browse back the parent of a record from a relation field like a One2Many we got a new instance instead of the instance we come from.
This is an unexpected behavior.
A common pattern where this behavior generates errors is this one:
record.field = <new value>
for line in record.lines:
line.on_change_field()
The on_change_field may depend on the parent field like this:
@fields.depends('parent')
def on_change_field(self):
if self.parent.field:
...
But of course, self.parent.field will not be evaluated as <new value> but with the value form the database.
I think we could inject in the _local_cache of the parent instance in ModelStorage.__getattr__