From 8a0151b4bcd4e5f1aea850c83653be4443f659c9 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 2 Feb 2017 11:00:23 +0100 Subject: [PATCH] [FIX] mail: unhide relevant "Odoo Session Expired" With how the chat manager was currently started, the "Odoo Session Expired" could cause an arcane js error which would overshadow it. This is caused by doing an RPC request too soon which invalidate the session too soon which disable web client `show_application`. With this commit, we have the error message "Odoo Session Expired" instead of: "Uncaught TypeError: Cannot read property '$el' of undefined" closes #15313 opw-706346 --- addons/mail/static/src/js/chat_manager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index f60e8c2eb3d..e8dd83d9017 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -1044,7 +1044,9 @@ function init () { bus.on('notification', null, on_notification); - return session.rpc('/mail/client_action').then(function (result) { + return session.is_bound.then(function(){ + return session.rpc('/mail/client_action'); + }).then(function (result) { _.each(result.channel_slots, function (channels) { _.each(channels, add_channel); });