From 34b7fd833ca8ae60d96bed58abcaf3cf84f1222a Mon Sep 17 00:00:00 2001 From: fwi-odoo Date: Wed, 14 Dec 2016 12:50:08 +0100 Subject: [PATCH] [IMP] web: allow mentioning people right after inviting them Before this commit, the list of channel members is fetched once, and never reloaded. So, when a new member is invited, he cannot be mentionned by the autocompletion. With this commit, we remove the 'members_deferred' from the channel, which will cause the member list to be refetched next time it is needed. --- addons/mail/static/src/js/client_action.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js index 4f11030b92a..90b8efeca94 100644 --- a/addons/mail/static/src/js/client_action.js +++ b/addons/mail/static/src/js/client_action.js @@ -78,6 +78,9 @@ var PartnerInviteDialog = Dialog.extend({ var names = _.escape(_.pluck(data, 'text').join(', ')); var notification = _.str.sprintf(_t('You added %s to the conversation.'), names); self.do_notify(_t('New people'), notification); + // Clear the members_deferred to fetch again the partner + // when get_mention_partner_suggestions from the chat_manager is triggered + delete chat_manager.get_channel(self.channel_id).members_deferred; }); } },