Hi,
I have a One2many in a model, and a Many2one as an inverse. I'm noticing however that the Many2one is only filled once the One2many is saved.
The reason why this is an issue is because I want to use this Many2one in another One2many inside that child model, but I dont want to create child 1 first before having to create child 2.
So summarised:
Model 1 has a One2many of Model 2
Model 2 then has a One2many of Model 3 (and Many2one of Model 1)
Model 3 has a Many2one which has a domain, that relies on a (related) value up to Model 1. So Many2one(Model 1, related='Model 2.Model 1')
Hope this makes sense.
Ok, so as an addition to this: I sort of understand why it's going wrong, but still don't know how to fix it.
I believe it's because the original record of model 1 goes into a sort of edit-state. Which means that the many2one of model 2 only knows the edit-state version of model 1 and not the origin. I can however select the original record of model 1, after which I can do the rest (i.e. the domain is filled correctly).
So question becomes: how do I make sure the original record of model 1 is filled in the many2one in model 2?