From fa5af20ba76f37c7153099a3194c16cf72dca68f Mon Sep 17 00:00:00 2001 From: "Achraf (abz)" Date: Thu, 24 Dec 2020 15:07:26 +0000 Subject: [PATCH] [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#63844 X-original-commit: d9097c2b6244154ea64142b5e8fd31cfdd34e66e Signed-off-by: Achraf --- odoo/tools/mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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())