Hi,
I need to add a new menu item after the "Preference" which is on the top right corner of odoo.How can i add a menu item on that menu(menu appearing while clicking on that user).
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
I need to add a new menu item after the "Preference" which is on the top right corner of odoo.How can i add a menu item on that menu(menu appearing while clicking on that user).
Hi,
Try the following code(which add a new menu item named "User Manual") for adding new menuitem on the top-right user menu
In .xml
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-extend="UserMenu.Actions">
<t t-jquery="a[data-menu='settings']" t-operation="after">
<a role="menuitem" href="#" data-menu="manual" class="dropdown-item">User Manual</a>
</t>
</t>
</templates>
in.js
odoo.define('documentation.data', function (require) {
"use strict";
var page=require('web.UserMenu');
var ajax = require('web.ajax');
var rpc = require('web.rpc');
var usepage=page.include({
_onMenuManual: function () {
var base_url = window.location.origin;
window.open(base_url + '/user_manual/', '_blank');
},
})
});
Regards
Hi,
See the sample code of adding new item there,
<t t-extend="UserMenu.Actions">
<t t-jquery=".dropdown-divider" t-operation="before">
<a role="menuitem" href="#" data-menu="shortcuts" class="dropdown-item d-none d-md-inline-block">Shortcuts</a>
</t>
</t>
You can get the detailed explanation in this answer: https://www.odoo.com/forum/help-1/question/how-to-customize-user-menu-in-odoo-11-135608
Also as an example refer this v12 module which add new option there, you can download and see the code : https://apps.odoo.com/apps/modules/12.0/app_odoo_customize/
Thanks
May be this will helpful
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký
Thanks @Cybrosys Techno Solutions @Niyas Raphy