From d6b8c148a5a94ce93182ad006901d2f0bb8adb80 Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Thu, 31 Aug 2023 13:09:57 +0200 Subject: [PATCH] [FIX] im_livechat: do not allow message edition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, message edition was available when pressing the arrow up key. This was a mistake since the message edition route is not available yet for livechat visitors. This PR fixes this issue. closes odoo/odoo#133815 X-original-commit: ab7e70e809b3c7fa5044139582bd09a9e94ee377 Signed-off-by: Alexandre Kühn (aku) --- .../im_livechat/static/src/embed/core/message_model_patch.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/im_livechat/static/src/embed/core/message_model_patch.js b/addons/im_livechat/static/src/embed/core/message_model_patch.js index 0b21af55da8..4d2fa9e81b6 100644 --- a/addons/im_livechat/static/src/embed/core/message_model_patch.js +++ b/addons/im_livechat/static/src/embed/core/message_model_patch.js @@ -24,4 +24,8 @@ patch(Message.prototype, { } return !this.author || this.author?.id === session.livechatData.options.current_partner_id; }, + + get editable() { + return this.originThread.type !== "livechat" && this._super(); + }, });