From b3d2004bfcd33532e8e20c9c8924cb4546302c85 Mon Sep 17 00:00:00 2001 From: std-odoo Date: Wed, 5 Jul 2023 08:27:55 +0000 Subject: [PATCH] [FIX] mail_plugin: emails are escaped when we log them on the records Bug === Since 69f911d994a07e73e8d54afc2845be6b63f8b2bc , the body needs to be a Markup object if we don't want to escape it. So, when we log an email from the mail plugin, because we just log the string, it gets escaped. Task-3387100 closes odoo/odoo#128984 X-original-commit: ef068b3b0d7df9f2e064889c62623b34f31e156b Signed-off-by: Thibault Delavallee (tde) --- addons/mail_plugin/controllers/mail_plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mail_plugin/controllers/mail_plugin.py b/addons/mail_plugin/controllers/mail_plugin.py index a163a4a4edc..909b3e6a2f2 100644 --- a/addons/mail_plugin/controllers/mail_plugin.py +++ b/addons/mail_plugin/controllers/mail_plugin.py @@ -5,6 +5,7 @@ import base64 import json import logging import requests +from markupsafe import Markup from werkzeug.exceptions import Forbidden from odoo import http, tools, _ @@ -250,7 +251,7 @@ class MailPluginController(http.Controller): for name, content in attachments ] - request.env[model].browse(res_id).message_post(body=message, attachments=attachments) + request.env[model].browse(res_id).message_post(body=Markup(message), attachments=attachments) return True @http.route('/mail_plugin/get_translations', type="json", auth="outlook", cors="*")