From dded98a04cff2b1ae87721a8a998ab382d17242b Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 5 Jun 2018 16:37:51 +0200 Subject: [PATCH] [FIX] mail: open a channel in discuss on systray click User B mentions @UserA in a channel on discuss User A gets two notifications: one for direct chat,the other for the channel User A clicks on the notification for the channel Before this commit the form view of the channel was opened After this commit, the channel is opened in discuss OPW 1849577 closes #25074 --- addons/mail/static/src/js/systray.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/js/systray.js b/addons/mail/static/src/js/systray.js index a365760a485..19bd702e6bf 100644 --- a/addons/mail/static/src/js/systray.js +++ b/addons/mail/static/src/js/systray.js @@ -122,7 +122,7 @@ var MessagingMenu = Widget.extend({ if (channelID === 'channel_inbox') { var resID = $(event.currentTarget).data('res_id'); var resModel = $(event.currentTarget).data('res_model'); - if (resModel && resID) { + if (resModel && resModel !== 'mail.channel' && resID) { this.do_action({ type: 'ir.actions.act_window', res_model: resModel, @@ -130,7 +130,11 @@ var MessagingMenu = Widget.extend({ res_id: resID }); } else { - this.do_action('mail.mail_channel_action_client_chat', {clear_breadcrumbs: true}) + var clientChatOptions = {clear_breadcrumbs: true}; + if (resModel && resModel === 'mail.channel' && resID) { + clientChatOptions.active_id = resID; + } + this.do_action('mail.mail_channel_action_client_chat', clientChatOptions) .then(function () { self.trigger_up('hide_app_switcher'); core.bus.trigger('change_menu_section', chat_manager.get_discuss_menu_id());