From 2b17b7e83d997658392d310ad176c0367c8a7949 Mon Sep 17 00:00:00 2001 From: dbh Date: Fri, 2 Feb 2018 15:31:47 +0530 Subject: [PATCH] [FIX] mail: fix several traceback from a recent refactoring Revision on https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498 This commit fixes some leftovers from an intermediary state of the refactoring above. The following tracebacks should be fixed: - unsubscribe from a private channel - replay - inviting a user --- addons/mail/static/src/js/discuss.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/mail/static/src/js/discuss.js b/addons/mail/static/src/js/discuss.js index 3b405761169..2142a21da4a 100644 --- a/addons/mail/static/src/js/discuss.js +++ b/addons/mail/static/src/js/discuss.js @@ -99,7 +99,7 @@ var PartnerInviteDialog = Dialog.extend({ self.do_notify(_t('New people'), notification); // Clear the membersDeferred to fetch again the partner // when getMentionPartnerSuggestions from the chatManager is triggered - var channel = this.call('chat_manager', 'getChannel', self.channelID); + var channel = self.call('chat_manager', 'getChannel', self.channelID); delete channel.membersDeferred; }); } @@ -508,7 +508,7 @@ var Discuss = Widget.extend(ControlPanelMixin, { */ _selectMessage: function (messageID) { this.$el.addClass('o_mail_selection_mode'); - var message = this._getMessage(messageID); + var message = this.call('chat_manager', 'getMessage', messageID);; this.selected_message = message; var subject = "Re: " + message.record_name; this.extendedComposer.set_subject(subject); @@ -903,10 +903,10 @@ var Discuss = Widget.extend(ControlPanelMixin, { if (def) { def.then(function (value) { if (value !== 'granted') { - self._sendNotification(self, _t('Permission denied'), + self.call('bus_service', 'sendNotification', self, _t('Permission denied'), _t('Odoo will not have the permission to send native notifications on this device.')); } else { - self._sendNotification(self, _t('Permission granted'), + self.call('bus_service', 'sendNotification', self, _t('Permission granted'), _t('Odoo has now the permission to send you native notifications on this device.')); } }); @@ -963,7 +963,7 @@ var Discuss = Widget.extend(ControlPanelMixin, { * @private */ _onUnsubscribeButtonClicked: function () { - this._unsubscribe(this.channel); + this.call('chat_manager', 'unsubscribe', this.channel); }, });