From 29bd02e9b8f816978c81d6f143b2902876e716dd Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Tue, 6 Sep 2022 11:35:30 +0000 Subject: [PATCH] [FIX] bus: fix im status service listeners MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The im status service subscribes to the `become_main_tab`, `no_longer_main_tab` events. Since the PR improving the multi tab service, the multi tab itself is not an event target anymore but exposes a bus instance that should be used to subscribe to those events. The im status service is still based on the first version (that was using env.bus) which means the event will never be received. This commit fixes this issue. closes odoo/odoo#99635 Signed-off-by: Sébastien Theys (seb) --- addons/bus/static/src/im_status_service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/bus/static/src/im_status_service.js b/addons/bus/static/src/im_status_service.js index a9e712cf052..6eb44d23822 100644 --- a/addons/bus/static/src/im_status_service.js +++ b/addons/bus/static/src/im_status_service.js @@ -37,9 +37,9 @@ export const imStatusService = { if (multi_tab.isOnMainTab()) { startUpdatingBusPresence(); } - env.bus.addEventListener('become_main_tab', startUpdatingBusPresence); + multi_tab.bus.addEventListener('become_main_tab', startUpdatingBusPresence); bus_service.addEventListener('reconnect', startUpdatingBusPresence); - env.bus.addEventListener('no_longer_main_tab', stopUpdatingBusPresence); + multi_tab.bus.addEventListener('no_longer_main_tab', stopUpdatingBusPresence); bus_service.addEventListener('disconnect', stopUpdatingBusPresence); }, };