From 640a11a56e154cf02e8c069c458a04e4585ab352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Thu, 7 Sep 2023 16:50:08 +0000 Subject: [PATCH] [FIX] mail: jump to pinned message from notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, when pinning an old message from thread, then page reload then click on pinned message link in notification message in thread at time of pinning message, it fails to jump to the pinned message. This happens because the message is not in the store, therefore it attempts to jump to message `undefined`, which doesn't exist. This commit fixes the issue by inserting the message before attempting the highlighting that will jump to the message. closes odoo/odoo#134818 X-original-commit: 70769963d240add98ed2ee231412201434a825ba Signed-off-by: Sébastien Theys (seb) Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/core/common/thread.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/core/common/thread.js b/addons/mail/static/src/core/common/thread.js index 6b30b468667..1a830ca80da 100644 --- a/addons/mail/static/src/core/common/thread.js +++ b/addons/mail/static/src/core/common/thread.js @@ -202,7 +202,11 @@ export class Thread extends Component { const { oeType, oeId } = ev.target.dataset; if (oeType === "highlight") { await this.env.messageHighlight?.highlightMessage( - this.store.Message.get(Number(oeId)), + this.store.Message.insert({ + id: Number(oeId), + resId: this.props.thread.id, + resModel: this.props.thread.model, + }), this.props.thread ); }