From b3de4ee4bd9fbcfce48df9c68341c5baf55ce546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Thu, 3 Nov 2022 16:52:53 +0000 Subject: [PATCH] [FIX] mail: no traceback when deleting a message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, when deleting a message, there was a traceback. This was caused by `MessageView/onComponentUpdate` wrongly assuming `MessageView` from a single branching of identifying owner (`messageListViewItemOwner`), when there is another one (`deleteMessageConfirmViewOwner`), specific to when a message is being deleted. As a result, crash came from programming error of accessor on undefined relational field. Task-3055205 closes odoo/odoo#104995 X-original-commit: 1fbc125451c62b444ce49fa11c8216e52e299b64 Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/models/message_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/models/message_view.js b/addons/mail/static/src/models/message_view.js index da41fc1a3dc..d06898ec52b 100644 --- a/addons/mail/static/src/models/message_view.js +++ b/addons/mail/static/src/models/message_view.js @@ -127,7 +127,7 @@ registerModel({ this.highlight(); this.update({ doHighlight: clear() }); } - if (this.messageListViewItemOwner.threadViewOwnerAsLastMessageListViewItem && this.messageListViewItemOwner.isPartiallyVisible()) { + if (this.messageListViewItemOwner && this.messageListViewItemOwner.threadViewOwnerAsLastMessageListViewItem && this.messageListViewItemOwner.isPartiallyVisible()) { this.messageListViewItemOwner.threadViewOwnerAsLastMessageListViewItem.handleVisibleMessage(this.message); } if (this.prettyBodyRef.el && this.message.prettyBody !== this.lastPrettyBody) {