summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-10-31 20:43:03 +0100
committerChristophe Simonis <chs@odoo.com>2018-10-31 20:43:03 +0100
commitf6ca72b3ce9ecc9007ae5825d2c648e3b26b098e (patch)
tree7f58a009d826366f4bfbdcefbba5ac4c687c997c /addons/mail/static/src/js
parentc2bc3381508bfb002cb9af3c3b6655273f8c07d6 (diff)
parent21eb31d804722912993f34105af9ee5f1a31e090 (diff)
[MERGE] forward port branch saas-11.3 up to 21eb31d8047
Diffstat (limited to 'addons/mail/static/src/js')
-rw-r--r--addons/mail/static/src/js/services/chat_manager.js4
-rw-r--r--addons/mail/static/src/js/thread_field.js6
2 files changed, 9 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/services/chat_manager.js b/addons/mail/static/src/js/services/chat_manager.js
index aecf41b1d4f..70db9c29ed5 100644
--- a/addons/mail/static/src/js/services/chat_manager.js
+++ b/addons/mail/static/src/js/services/chat_manager.js
@@ -516,7 +516,9 @@ var ChatManager = AbstractService.extend({
if ('ids' in options) {
// get messages from their ids (chatter is the main use case)
return this._fetchDocumentMessages(options.ids, options).then(function (result) {
- self.markAsRead(options.ids);
+ if (options.shouldMarkAsRead) {
+ self.markAsRead(options.ids);
+ }
return result;
});
}
diff --git a/addons/mail/static/src/js/thread_field.js b/addons/mail/static/src/js/thread_field.js
index 6d036208eb2..bffa6817cf7 100644
--- a/addons/mail/static/src/js/thread_field.js
+++ b/addons/mail/static/src/js/thread_field.js
@@ -19,6 +19,7 @@ var ThreadField = AbstractField.extend({
init: function () {
this._super.apply(this, arguments);
this.msgIDs = this.value.res_ids;
+ this._markAsReadOnRender = true; // DO NOT FORWARD-PORT
},
willStart: function () {
return this.alive(this.call('chat_manager', 'isReady'));
@@ -68,6 +69,7 @@ var ThreadField = AbstractField.extend({
this.msgIDs = this.value.res_ids;
// the mail widgets being persistent, one need to update the res_id on reset
this.res_id = record.res_id;
+ this._markAsReadOnRender = true; // DO NOT FORWARD-PORT
},
//--------------------------------------------------------------------------
@@ -123,6 +125,10 @@ var ThreadField = AbstractField.extend({
var self = this;
options = options || {};
options.ids = ids;
+ if (this._markAsReadOnRender) {
+ options.shouldMarkAsRead = true;
+ this._markAsReadOnRender = false;
+ }
var fetch_def = this.dp.add(this.call('chat_manager', 'getMessages', options));
return fetch_def.then(function (raw_messages) {
var isCreateMode = false;