Api.onchange will trigger the call to the decorated function if any of the fields specified in the decorator is changed in the form:
In below code you can use in your .py file.
@api.onchange('fieldx')
def do_stuff(self):
if self.fieldx == x:
self.fieldy = 'toto'
Note- Api.onchange inside your function without being worried about altering database.
Thats the main difference with api.depends.
0 Comment(s)