None of them seem to work. I want to make a domain that correctly fetches the exam_type.
The model ‘exam_section.exam_type.renumeration’ also has the attribute ‘exam_type’
For now Eval does not support domain inversion, so you should create a functional field on your model that returns the value of the exam_type of your parent model. Something like:
exam_type = fields.Function(fields.Many2One(), 'on_change_with_exam_type')
@fields.depends('renumeration'):
def on_change_with_exam_type(self, name=None):
if self.renumeration and self.renumeration.exam:
return self.renumeration.exam.exam_type.id
That’s because you are probably missing some value on the depends decorator of the on_change_with, which makes the function to not be called when updating the parent field.