Odooprovides a universal method for defining new user menus and associated actions. Odoo is now more practical and simpler to use as a result.
Your profile photo appears in the top right corner of the page when you enter Odoo. The user menu, which appears when you click on the image, offers drop-down options like documentation, settings, shortcuts, support, etc.
To achieve this, the required value must be added to the appropriate Registries. They play a significant role in UI extensibility. The remainder of the web client can use the object after it has been registered.
The services that need to be activated are all listed in the service registry.
All of the menu items are stored in the Usermenu Registry.
We must expand the User menu registry to add a new user menu in order to do so.
All of the menu items shown when the user menu is opened are stored in the User Menu Registry (category: user menuitems).
Additionally, user menu items are defined by the use of functions that take the environment as an argument and output an object containing the data listed below:
The text of a menu item
Callback:To make a call when a selection is made
href:Use the href attribute to place the item’s value in the a> element.
Hide:To cover up the thing
Order:Establishes where the item stands in relation to other dropdown items.
Make a js file and place it in the static/src/js directory.
Automatic conversion to an Odoo module: /** @odoo-module **/.
Import the class or method.
We must add a function to the Web after importing.
After opening a template, UserMenu adds a new element with a particular value to the object.
window.location.href: return the href (URL) of the current page.
Activate the developer mode is a menu item that appears on the user menu when the module has been installed (top right of navigation bar).
Now select “Activate Developer Mode” from the menu. Developer mode is on, as you can see.
All menu items displayed when the user menu is opened are stored in the user menu registry (the navbar element with the username, on the top right).
Reach new heights with WanBuffer’s offshore engineering team. Our team of over 50 highly skilled and dedicated full-stack software engineers have the expertise and experience to tackle your key technology challenges, improve efficiency and reduce expenses. Let us help you drive your business forward today.Let’s Schedule Meeting