[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) <nle@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
This commit is contained in:
Antoine (ande)
2023-08-17 18:43:28 +02:00
parent a27556a781
commit 0a0cbe9041
+1
View File
@@ -392,6 +392,7 @@ def html2plaintext(html, body_id=None, encoding='utf-8'):
html = html.replace('&gt;', '>')
html = html.replace('&lt;', '<')
html = html.replace('&amp;', '&')
html = html.replace('&nbsp;', '\N{NO-BREAK SPACE}')
# strip all lines
html = '\n'.join([x.strip() for x in html.splitlines()])