[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) <dmo@odoo.com>
This commit is contained in:
Antoine Guenet
2022-02-21 08:41:45 +00:00
parent 0ae13be7de
commit def50847d5
+1 -1
View File
@@ -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