تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6634 أدوات العرض

hello guys can i add button on main navigation bar at the top same line with the login user? thanks in advance :)

الصورة الرمزية
إهمال
أفضل إجابة

Create a custom xml template for the button ie

<templates>

<t t-name="MyModule.TopButtonMenu">
<li class="o_mail_navbar_item">
<button>My Button</button>
</li>
</t>
</templates>

And place it at the top menu with javascript

odoo.define('MyModule.TopButton', function(require) {
"use strict";
​var SystrayMenu = require('web.SystrayMenu');
var TopButton = Widget.extend({
template:'MyModule.TopButtonMenu',
events: {
"click": "on_click"
},
on_click: function (event) {
//do action
}
});
SystrayMenu.Items.push(TopButton);
});
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أكتوبر 20
3738
0
أغسطس 19
3780
1
أغسطس 19
10066
2
يوليو 23
784
0
مايو 20
2508