[FIX] mail, im_livechat: fix website livechat chatbot flow tour

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) <aku@odoo.com>
This commit is contained in:
tsm-odoo
2023-09-08 12:24:50 +00:00
parent d401f368c2
commit 0a9f46d992
@@ -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;
},