I am trying to use a on_change method. The field that I am trying to use it on is a selection field. The selection field is on a one2many field that tries to use the value from the parent view. Example -
here the ‘patient’ is the many2one field that is created to create a one2many field.
On changing the attendants_relation here, self.patient comes as None (until the record in one2many is not saved). Is there any way to access the data from the parent view ?
I’m not sure if there is a way to fill the selection field doing it this way, so maybe I’m wrong, but I would set the on_change on the one2many field, and iterate all the rows, setting the value for the attendants_relation field when it is needed.