All the work and tasks are done in the cache in on_change context. Therefore so you dont need to be worried for altering database as the recordSet will be able to altred inside your function. Thats the main difference with @api.depends.
For example you can see below code.
@api.onchange('fieldx')
def do_stuff(self):
if self.fieldx == x:
self.fieldy = 'toto'
Note- function return, differences between the cache and the RecordSet will be returned to the form.
0 Comment(s)