From 65c8ea060a465ec14b299db2ac7b342092115821 Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Wed, 24 May 2023 09:06:43 +0000 Subject: [PATCH] [FIX] mass_mailing: fix incorrect mark up in chatter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Markup usage has been enforced in the mail module since [1]. In mass mailing, a `Markup` array is joined usin the string method thus the resul is not marked up which leads to html structure being printed to the dom. This PR fixes this issue. [1] https://github.com/odoo/odoo/pull/111850 closes odoo/odoo#123705 X-original-commit: 59f4cf98aadd6b740cbb1d9c92188ea1d708648f Signed-off-by: Alexandre Kühn (aku) Signed-off-by: Stockbauer Matthieu (tsm) --- addons/mass_mailing_sms/wizard/mailing_sms_test.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/mass_mailing_sms/wizard/mailing_sms_test.py b/addons/mass_mailing_sms/wizard/mailing_sms_test.py index 44dad036712..7ba96ffbf5b 100644 --- a/addons/mass_mailing_sms/wizard/mailing_sms_test.py +++ b/addons/mass_mailing_sms/wizard/mailing_sms_test.py @@ -54,14 +54,15 @@ class MassSMSTest(models.TransientModel): _('Test SMS successfully sent to %s', sent_sms.get('res_id'))) elif sent_sms.get('state'): notification_messages.append( - _('Test SMS could not be sent to %s:
%s', + _('Test SMS could not be sent to %s: %s', sent_sms.get('res_id'), error_messages.get(sent_sms['state'], _("An error occurred."))) ) if notification_messages: - self.mailing_id._message_log(body=Markup('
    %s
') % ''.join( - [Markup('
  • %s
  • ') % notification_message for notification_message in notification_messages] - )) + message_body = Markup( + f"
      {''.join('
    • %s
    • ' for _ in notification_messages)}
    " + ) % tuple(notification_messages) + self.mailing_id._message_log(body=message_body) return True