summaryrefslogtreecommitdiff
path: root/odoo/tools
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2018-05-08 16:46:23 +0200
committerNicolas Lempereur <nle@odoo.com>2018-05-08 16:46:23 +0200
commitd595e3a258f5f1f45b0b3dcf4ab43fdfebc83d40 (patch)
tree218d095110aa1aea1896d8eb327961791d4626c7 /odoo/tools
parentb739e659400a223ec2b6d41ef57f27966edfe294 (diff)
[FIX] tools: mail transcoding css space consistent
The transcoding of a mail (transforming CSS into inline styles on the element nodes of the mail) used the form: property:value; So when a mail is saved, it would be eg. with `style="property:value;"` and when it is being edited "property:value" is removed if available via CSS stylesheet given the structure. But the sanitize_style (introduced in bfe7aafa7) adds an espace before the value (which is more pretty but was probably not choosen in transcoding to decrease size of mail): property: value; so the inline style would not be removed when editing possibly causing conflict with the editor. With this commit, the sanitize_style doesn't add a space. It could have been changed in transcoding but the code is already rather slow and we don't want to use a regex replace or two string replace instead of the current one string replace. opw-1841107
Diffstat (limited to 'odoo/tools')
-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 285808cd0cd..65ba6b32be1 100644
--- a/odoo/tools/mail.py
+++ b/odoo/tools/mail.py
@@ -154,7 +154,7 @@ class _Cleaner(clean.Cleaner):
if style[0].lower() in self._style_whitelist:
valid_styles[style[0].lower()] = style[1]
if valid_styles:
- el.attrib['style'] = '; '.join('%s: %s' % (key, val) for (key, val) in valid_styles.iteritems())
+ el.attrib['style'] = '; '.join('%s:%s' % (key, val) for (key, val) in valid_styles.iteritems())
else:
del el.attrib['style']