From 0a9f46d992d02e89d722db529c97cf86bf29c1ef Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Fri, 8 Sep 2023 13:15:30 +0200 Subject: [PATCH] [FIX] mail, im_livechat: fix website livechat chatbot flow tour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes the "website_livechat_chatbot_flow_tour" which was nondeterministic. This was due to the message service update which was assigning data blindly based on the payload instead of handling it properly. This is solved by enriching the chatbot step instead of overwriting it. runbot-24625 closes odoo/odoo#134778 Signed-off-by: Alexandre Kühn (aku) --- .../im_livechat/static/src/embed/core/message_model_patch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2fc28b6f868..d8b93caf830 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 @@ -8,9 +8,10 @@ import { patch } from "@web/core/utils/patch"; patch(Message, { insert(data) { + const chatbotStep = this.store.Message.get(data)?.chatbotStep; const message = super.insert(data); if (data.chatbotStep) { - message.chatbotStep = new ChatbotStep(data.chatbotStep); + message.chatbotStep = new ChatbotStep({ ...chatbotStep, ...data.chatbotStep }); } return message; },