Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6654 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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);
});
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 10 20
3747
0
thg 8 19
3786
1
thg 8 19
10084
2
thg 7 23
784
0
thg 5 20
2512