From bcb32beb49e5d86ea0d6307cbeeb7e85a22d18b0 Mon Sep 17 00:00:00 2001 From: "Didier (did)" Date: Mon, 7 Dec 2020 09:13:24 +0000 Subject: [FIX] mail: mark all needaction as read when opening the thread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was the case before the refactoring. task-2411114 closes odoo/odoo#62942 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/models/thread/thread.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'addons/mail/static/src/models/thread/thread.js') diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js index 4e1f1119351..6135a8802c3 100644 --- a/addons/mail/static/src/models/thread/thread.js +++ b/addons/mail/static/src/models/thread/thread.js @@ -1077,6 +1077,7 @@ function factory(dependencies) { /** * @private + * @returns {boolean} */ _computeHasSeenIndicators() { if (this.model !== 'mail.channel') { @@ -1509,23 +1510,23 @@ function factory(dependencies) { } /** - * Fetches followers of chats when they are displayed for the first - * time. This is necessary to clean the followers. - * @see `_onChangeFollowersPartner` for more information. - * * @private */ _onChangeThreadViews() { - if (this.channel_type !== 'chat') { - return; - } if (this.threadViews.length === 0) { return; } - if (this.areFollowersLoaded) { - return; + /** + * Fetches followers of chats when they are displayed for the first + * time. This is necessary to clean the followers. + * @see `_onChangeFollowersPartner` for more information. + */ + if (this.channel_type === 'chat' && !this.areFollowersLoaded) { + this.refreshFollowers(); + } + if (this.needactionMessagesAsOriginThread.length > 0) { + this.markNeedactionMessagesAsOriginThreadAsRead(); } - this.refreshFollowers(); } /** -- cgit v1.2.3