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 -
@fields.depends('patient', 'attendants_relation')
def on_change_attendants_relation(self):
if self.attendants_relation == 'Self':
self.attendant_name = self.patient.patient_name
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 ?