Hello
I am trying to use the @api.onchange with two dropdown menus and although I am not getting any errors, it is not working how I would like.
I have 2 fields created:
"status_id": fields.many2one("profile.status", "Kontaktstatus"),
"phase_id": fields.many2one("profile.phase", "Phase"),
and I would like that when I change the phase_id that the status_id will change automatically based on what is selected. Here is my def code:
@api.onchange('phase_id')
def do_stuff(self):
if self.phase_id != '':
if self.phase_id == "Kontaktphase":
self.status_id == "Interessant"
elif self.phase_id == "Präsentationphase":
self.status_id == "Kandidat"
elif self.phase_id == "Testphase":
self.status_id == "Kandidat"
elif self.phase_id == "Angebotsphase":
self.status_id == "Kandidat"
What am I doing wrong here?