From 50ee6431651abf0b785cfb8309e56a2c9862905a Mon Sep 17 00:00:00 2001 From: David Beal Date: Tue, 2 Jan 2018 15:59:43 +0100 Subject: [PATCH] IMP README use case --- mail_inline_css/README.rst | 8 ++++++++ mail_inline_css/models/mail.py | 5 ++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mail_inline_css/README.rst b/mail_inline_css/README.rst index b76d1dfe..b67fc9c2 100644 --- a/mail_inline_css/README.rst +++ b/mail_inline_css/README.rst @@ -55,6 +55,14 @@ Just use any mail template as Odoo standard feature :target: https://runbot.odoo-community.org/runbot/205/10 +Note: + + Odoo with module web_editor already implements this feature on the client side (js). + This module brings this server side feature for cases without js part. It could the more stable way over the Odoo versions with a stable api in a dedicated library + with adhoc python unit tests. + + + Bug Tracker =========== diff --git a/mail_inline_css/models/mail.py b/mail_inline_css/models/mail.py index 58135b2b..a4be0194 100644 --- a/mail_inline_css/models/mail.py +++ b/mail_inline_css/models/mail.py @@ -18,7 +18,6 @@ class MailTemplate(models.Model): def generate_email(self, res_ids, fields=None): res = super(MailTemplate, self).generate_email(res_ids, fields=fields) - for id in res: - if res[id].get('body_html'): - res[id]['body_html'] = transform(res[id]['body_html']) + if 'body_html' in res: + res['body_html'] = transform(res['body_html']) return res