From 32d2b9f8f5c0bfb2adec109e2e9c24b11627fd70 Mon Sep 17 00:00:00 2001 From: Juan Jose Scarafia Date: Fri, 24 Jul 2020 23:23:49 -0300 Subject: [PATCH] [IMP] web_notify: add channels only if not done already --- web_notify/static/src/js/web_client.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/web_notify/static/src/js/web_client.js b/web_notify/static/src/js/web_client.js index 0d8f4ab4d..6eb274b1b 100644 --- a/web_notify/static/src/js/web_client.js +++ b/web_notify/static/src/js/web_client.js @@ -24,13 +24,16 @@ odoo.define("web_notify.WebClient", function(require) { this.channel_info, this.channel_default, ]; - this.call("bus_service", "addChannel", this.channel_success); - this.call("bus_service", "addChannel", this.channel_danger); - this.call("bus_service", "addChannel", this.channel_warning); - this.call("bus_service", "addChannel", this.channel_info); - this.call("bus_service", "addChannel", this.channel_default); - this.call("bus_service", "on", "notification", this, this.bus_notification); this.call("bus_service", "startPolling"); + + if (this.call("bus_service", "isMasterTab")) { + this.call("bus_service", "addChannel", this.channel_success); + this.call("bus_service", "addChannel", this.channel_danger); + this.call("bus_service", "addChannel", this.channel_warning); + this.call("bus_service", "addChannel", this.channel_info); + this.call("bus_service", "addChannel", this.channel_default); + } + this.call("bus_service", "on", "notification", this, this.bus_notification); }, bus_notification: function(notifications) { var self = this;