summaryrefslogtreecommitdiff
path: root/odoo
diff options
context:
space:
mode:
authorAchraf (abz) <abz@odoo.com>2020-12-24 15:07:26 +0000
committerAchraf (abz) <abz@odoo.com>2020-12-28 15:10:10 +0000
commit24dff0b021497ceb7a7af62cb82797e00d487639 (patch)
tree88e5cdd2aadb2f8d23bf70b1b5a5aeda8e111be7 /odoo
parente0af10ccc92cb3b07f0eea6fa44ebf5a1bdc86aa (diff)
[FIX] odoo_tools/mail.py: Crash at html2plaintext if no tree
What are the steps to reproduce your issue ? 1. Install website_blog 2. Go to website and add a new blog post 3. Remove the block content 4. Save and go to Blog page What is currently happening ? Crash: Template fallback An error occured while rendering the template website_blog.post_teaser opw-241937 closes odoo/odoo#63840 X-original-commit: d9097c2b6244154ea64142b5e8fd31cfdd34e66e Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Diffstat (limited to 'odoo')
-rw-r--r--odoo/tools/mail.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/tools/mail.py b/odoo/tools/mail.py
index c98a575f10a..026976e112b 100644
--- a/odoo/tools/mail.py
+++ b/odoo/tools/mail.py
@@ -304,7 +304,7 @@ def html2plaintext(html, body_id=None, encoding='utf-8'):
html = ustr(html)
- if not html:
+ if not html.strip():
return ''
tree = etree.fromstring(html, parser=etree.HTMLParser())