This question has been flagged

Can anyone point me in the general direction to trigger a function when I select a specific payment journal? I can't seem to get it working since a popup appears when you try to select a payment journal. I guess it's the same way you call any field from a popup but I'm stumped.

Avatar
Discard
Best Answer

Hi Mark,

I think you can achieve this by giving a onchage function for  that field, inside the onchange function you can check whether the journal is the exact one or not. If yes you can continue.

Thank you


@api.onchange('journal_id')
def check_journal(self):
if self.journal_id and self.journal_id.id == 1:
# here you can write the function body
# make necessary change in if condition, its just a sample
Avatar
Discard