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

If the user changed the company from the top bar dropdown. I want to run a function. Can I know how to detect company changed or not in the environment?


I am using Odoo 13 enterprise 

아바타
취소
베스트 답변

Hello Sandaruwan
yes you can if any user change the company from the drop-down
then there is one JS method called setCompanies() in web/static/src/js/core/session.js
you can inherit that method and include your code

setCompanies: function (main_company_id, company_ids) {
var hash = $.bbq.getState()
hash.cids = company_ids.sort(function(a, b) {
if (a === main_company_id) {
return -1;
} else if (b === main_company_id) {
return 1;
} else {
return a - b;
}
}).join(',');
utils.set_cookie('cids', hash.cids || String(main_company_id));
$.bbq.pushState({'cids': hash.cids}, 0);
####write your code here####
location.reload();
},


Best Regards,
Bhavesh Jadav

아바타
취소
관련 게시물 답글 화면 활동
0
7월 23
2445
2
4월 21
5018
1
7월 20
2793
0
2월 23
4052
7
9월 21
28423