What Is the Use of api.onchange in Odoo15 | @api.onchange Odoo15 | Odoo 15 Development Tutorials
Odoo api.onchange decorator is used to invoke a method when a field's value changed. It can be used to validate the data or to trigger an action.
Video Contents
00:15 Introduction
00:45 Define an onchange function
The function of this decorator will be called when the field value changes. Moreover, it supports only single field names; on the contrary, dotted names such as parent_id.field_name will not be considered.
Furthermore, onchange methods are invoked on pseudo-records that contain values of the form. In this video, we are invoking a function to set the country automatically when we set a value in the Nationality field.
Connect With Us:
➡️Website: https://www.cybrosys.com/
➡️Email : info@cybrosys.com
➡️Twitter: https://twitter.com/cybrosys
➡️LinkedIn: https://www.linkedin.com/company/cybrosys/
➡️Facebook: https://www.facebook.com/cybrosystechnologies
➡️Instagram: https://www.instagram.com/cybrosystech/
➡️Pinterest: https://in.pinterest.com/cybrosys/