Hello,
I have a wizard form with several fields (let's call them A and B) that trigger an onchange function. I have another field (let's call it C) with its own onchange function, that may also update A and B (depending on certain criteria):
@api.onchange('a','b')
def onchange_ab(self):
self.do_something()
@api.onchange('c')
def onchange_c(self):
if self.some_criteria:
self.a = False #triggers onchange_ab
self.b = False #triggers onchange_ab again
The problem is that when I change C, and both A and B are updated, A and B's onchange function triggers twice. This module is meant to manage a sizeable amount of data so triggering it twice is indeed quite expensive, so I want to update both A and B first, and then trigger the onchange function only once. Is this possible?
Thanks.
P.S. I tried self.write({'a': False, 'b': False}) to no avail