[FIX] mail_plugin: emails are escaped when we log them on the records

Bug
===
Since 69f911d994 , 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) <tde@openerp.com>
This commit is contained in:
std-odoo
2023-07-19 19:37:55 +02:00
parent 3afb21cc81
commit b3d2004bfc
@@ -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="*")