Description:
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.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.