From def50847d5d895fa6d048003afc256700231ea3e Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Fri, 18 Feb 2022 13:43:22 +0000 Subject: [PATCH] [FIX] mass_mailing: properly convert base64 images The function that converts inline images to urls returned the modified html as a byte string. As a result, the Mail Debug tab showed a hexadecimal string rather than rendered html. This makes sure the string is encoded in unicode instead, so the format of the string coming out of the function is the same as it was coming in. closes odoo/odoo#84942 X-original-commit: b4094ed004a59512d70913f9cc41de8df894296e Signed-off-by: David Monjoie (dmo) --- addons/mass_mailing/models/mailing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mass_mailing/models/mailing.py b/addons/mass_mailing/models/mailing.py index 21583e08f68..9014169bc47 100644 --- a/addons/mass_mailing/models/mailing.py +++ b/addons/mass_mailing/models/mailing.py @@ -1208,6 +1208,6 @@ class MassMailing(models.Model): modified = True if modified: - return lxml.html.tostring(root) + return lxml.html.tostring(root, encoding='unicode') return body_html