summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models
diff options
context:
space:
mode:
authorDidier (did) <did@odoo.com>2020-12-07 09:13:24 +0000
committerSébastien Theys <seb@odoo.com>2020-12-10 12:33:14 +0000
commitbcb32beb49e5d86ea0d6307cbeeb7e85a22d18b0 (patch)
tree49ac1f6506eeb79c4e5696a128372696195757a9 /addons/mail/static/src/models
parent6d75304604687d873b296c630b87bc184e221018 (diff)
[FIX] mail: mark all needaction as read when opening the thread
This was the case before the refactoring. task-2411114 closes odoo/odoo#62942 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models')
-rw-r--r--addons/mail/static/src/models/thread/thread.js21
1 files changed, 11 insertions, 10 deletions
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();
}
/**