From 7d16ae555199e48d50cd07e98619b259b4d55703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 9 Jan 2023 15:33:54 +0000 Subject: [PATCH] [FIX] point_of_sale: avoid entities in emails Purpose of this commit is to avoid html entities in sent emails message by correctly using string and html formatting. Task-2710804 (Mail: Clean MailThread Posting API) Part-of: odoo/odoo#99482 --- addons/point_of_sale/models/pos_order.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 6ae66174f50..7500422d06e 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -2,6 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from datetime import timedelta +from markupsafe import Markup from functools import partial from itertools import groupby from collections import defaultdict @@ -923,7 +924,12 @@ class PosOrder(models.Model): } def _prepare_mail_values(self, name, client, ticket): - message = _("

Dear %s,
Here is your electronic ticket for the %s.

") % (client['name'], name) + message = Markup( + _("

Dear %(client_name)s,
Here is your electronic ticket for the %(pos_name)s.

") + ) % { + 'client_name': client['name'], + 'pos_name': name, + } return { 'subject': _('Receipt %s', name),