From 4f12598008eba2bb2e65016e12acf3edd5d83f8c Mon Sep 17 00:00:00 2001 From: Xavier Dubuc Date: Fri, 18 Sep 2020 10:09:04 +0000 Subject: [FIX] mail: use compute fields for identifying relations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (in message seen indicators) task-2335647 closes odoo/odoo#58373 X-original-commit: 3d4ff42f4474a5761c9e0737297d973992a2fcc2 Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/models/thread/thread.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'addons/mail/static/src/models/thread') diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js index 8e7aee26bc9..09fcd46afed 100644 --- a/addons/mail/static/src/models/thread/thread.js +++ b/addons/mail/static/src/models/thread/thread.js @@ -221,6 +221,12 @@ function factory(dependencies) { if (!data.seen_partners_info) { data2.partnerSeenInfos = [['unlink-all']]; } else { + /* + * FIXME: not optimal to write on relation given the fact that the relation + * will be (re)computed based on given fields. + * (here channelId will compute partnerSeenInfo.thread)) + * task-2336946 + */ data2.partnerSeenInfos = [ ['insert-and-replace', data.seen_partners_info.map( @@ -245,12 +251,18 @@ function factory(dependencies) { return currentSet; }, new Set()); if (messageIds.size > 0) { + /* + * FIXME: not optimal to write on relation given the fact that the relation + * will be (re)computed based on given fields. + * (here channelId will compute messageSeenIndicator.thread)) + * task-2336946 + */ data2.messageSeenIndicators = [ ['insert', [...messageIds].map(messageId => { return { - id: this.env.models['mail.message_seen_indicator'].computeId(messageId, data.id || this.id), - message: [['insert', { id: messageId }]], + channelId: data.id || this.id, + messageId, }; }) ] -- cgit v1.2.3