From 0a0cbe90413f1fcb32f6e12c73b47ab78a5e86aa Mon Sep 17 00:00:00 2001 From: "Antoine (ande)" Date: Tue, 18 Jul 2023 13:52:20 +0000 Subject: [PATCH] [FIX] tools: nbsp html character Current behaviour: When sending an email from Odoo,   can be seen in plaintext. Steps to reproduce: 1. Install sale_management 2. Head over to Sales > Quotations 3. Create a new quotation 4. Enter a partner 5. Click on Send by email 6. [...] S00021 amounting in $ 12.00 [...] Fix: When parsing to plaintext, replacing html character by unicode character opw-3389602 closes odoo/odoo#132203 X-original-commit: 3e3f1e67dd5894a41c830344ed41c91a5e44159e Signed-off-by: Nicolas Lempereur (nle) Signed-off-by: Antoine Demany (ande) --- odoo/tools/mail.py | 1 + 1 file changed, 1 insertion(+) diff --git a/odoo/tools/mail.py b/odoo/tools/mail.py index 3eec9187926..8391b44f01f 100644 --- a/odoo/tools/mail.py +++ b/odoo/tools/mail.py @@ -392,6 +392,7 @@ def html2plaintext(html, body_id=None, encoding='utf-8'): html = html.replace('>', '>') html = html.replace('<', '<') html = html.replace('&', '&') + html = html.replace(' ', '\N{NO-BREAK SPACE}') # strip all lines html = '\n'.join([x.strip() for x in html.splitlines()])