summaryrefslogtreecommitdiff
path: root/addons/web
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2020-03-19 12:20:32 +0000
committerYannick Tivisse <yti@odoo.com>2020-03-19 15:31:08 +0000
commit86691b1379ebb470c73030926a118e9f3770bf70 (patch)
treefae455d652f41e7444a9f0641311aef60dd6dcb7 /addons/web
parent11cd84317d5f40a68d5286ce581ce9c141afcd85 (diff)
[FIX] web: Fix switch company menu glitch on mobile
Purpose ======= When being logged on company A and clicking on company B, I should log into the company A only. Currently in mobile, the checkbox next to A remains enabled before the refresh. With this commit, this behavior is fixed. closes odoo/odoo#48045 Taskid: 2205603 X-original-commit: 19f196c0afd73c5d64b612aa413e6e6772e0c288 Related: odoo/enterprise#9373 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/web')
-rw-r--r--addons/web/static/src/js/widgets/switch_company_menu.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/widgets/switch_company_menu.js b/addons/web/static/src/js/widgets/switch_company_menu.js
index b8fef0526aa..061edbf8b47 100644
--- a/addons/web/static/src/js/widgets/switch_company_menu.js
+++ b/addons/web/static/src/js/widgets/switch_company_menu.js
@@ -65,9 +65,12 @@ var SwitchCompanyMenu = Widget.extend({
if (dropdownItem.find('.fa-square-o').length) {
// 1 enabled company: Stay in single company mode
if (this.allowed_company_ids.length === 1) {
+ if (this.isMobile) {
+ dropdownMenu = dropdownMenu.parent();
+ }
dropdownMenu.find('.fa-check-square').removeClass('fa-check-square').addClass('fa-square-o');
dropdownItem.find('.fa-square-o').removeClass('fa-square-o').addClass('fa-check-square');
- allowed_company_ids = [companyID]
+ allowed_company_ids = [companyID];
} else { // Multi company mode
allowed_company_ids.push(companyID);
dropdownItem.find('.fa-square-o').removeClass('fa-square-o').addClass('fa-check-square');