The document discusses Odoo's @api.onchange decorator which triggers a method when a field value changes. It describes how the decorator works, that it only supports single field names, and that onchange methods are invoked on pseudo-records in the cache. It provides an example of changing the user field to accordingly change the email field. It also discusses how to define menus, sub-menus and actions for a model in the Odoo interface.
2. ● 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. A
detailed explanation of the technical and functional aspects
of the Onchange mechanical of Odoo.
● Furthermore, an insight into the Odoo api.onchange
decorator operations which are used to invoke a method
when a field’s value changed in the platform.
3. api.onchange
● The function of the decorator will be called when the field
value changes.
● Moreover, it supports only single field names; on the
contrary, dotted names will not be considered.
● Furthermore, onchange methods are invoked on pseudo-
records that contain values of the form.
5. ● @api.onchange “decorator will trigger the call to the decorated
function if any of the fields specified in the decorator is changed
in the form”.
● In previous sample self corresponds to the record currently
edited on the form. When in onchange context all work is done in
the cache.
7. ● Changing the user field the email field will change accordingly.
8. When we define the menu,sub-menus, and action for the
corresponding model.This is the main menu we created for
Customer Details.
9. Here we have sub-menu Reports and Customer Details Report.
10. In the developer mode, Go to>Settings>Technical>User Interface>Menu
Items
12. ● Menu - Name of the menu
● Parent Menu - Parent menu if any
● Sequence - sequence in which the menu has to appear.
● Action - we have to choose ir.action.act_window so that another
field appears in which we can choose the respective action that
has to be called on clicking the menu. In this example, I will give
the action only for the sub-menu.
● Access Rights - If we need to give access only to a particular
user group, we can add access rights.
● Submenus- If we need to add a sub-menu for the menu, we can
add it here,