콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
7042 화면

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
10월 20
4277
0
8월 19
4251
1
8월 19
10567
2
7월 23
784
0
5월 20
2841