summaryrefslogtreecommitdiff
path: root/addons/mail/data/mail_data.xml
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-12-10 16:01:03 +0100
committerDenis Ledoux <dle@odoo.com>2015-12-10 16:58:15 +0100
commit4bebbfdcf5e50643f136c7b297697715fa6b3087 (patch)
tree295af1d64b9bac534b65317252c28a2ca9998026 /addons/mail/data/mail_data.xml
parent893fbc05535f6e19a4185d4a5d7cf703a44bdcd0 (diff)
[FIX] mail: jinja2 code compatible with wysiwyg for notifications
When editing an email template with the wysiwyg, the `<` and `>` operators are automatically converted to `&lt;` and `&gt;`, even for the Jinja2 conditions, therefore breaking these conditions, and the render of the email templates. We avoid to use these operators in the email template, so users can customize the notification email template without having an advanced knowledge on how to edit an email template containing Jinja2 code. Besides, the line return at the end of the email template, just after the `% endif`, is done on purpose as well: the wysiwyg adds automatically, at the time of this revision, `<p></p>` at the end of the email template source, but this cannot be added on the same line than `% endif`, otherwise this is considered as Jinja2 code, and it's not. opw-659113
Diffstat (limited to 'addons/mail/data/mail_data.xml')
-rw-r--r--addons/mail/data/mail_data.xml10
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml
index 2b2f389726b..327c776b987 100644
--- a/addons/mail/data/mail_data.xml
+++ b/addons/mail/data/mail_data.xml
@@ -83,7 +83,7 @@
% endif
% if not ctx.get('button_access') and not ctx.get('button_follow') and not ctx.get('button_unfollow') and ctx.get('model_name'):
- <p style="padding: 5px 10px; font-size: 12px;"">
+ <p style="padding: 5px 10px; font-size: 12px;">
About <strong>${ctx['model_name']}
% if ctx.get('record_name'):
: ${ctx['record_name']}
@@ -97,7 +97,7 @@
% if ctx.get('actions'):
% for action in ctx['actions']:
<a href="${action['url']}" style="text-decoration:none; color: #a24689;"><strong>${action['title']}</strong></a>
- %if len(ctx['actions']) > 1 and loop.index < len(ctx['actions']):
+ %if cmp(len(ctx['actions']), 1) == 1 and cmp(len(ctx['actions']), loop.index) == 1:
|
% endif
% endfor
@@ -113,6 +113,7 @@
<strong>using</strong>
<a href="www.odoo.com" style="text-decoration:none; color: #a24689;"><strong>Odoo</strong></a>
% endif
+ </p>
</td>
</tr>
</tbody></table>
@@ -136,7 +137,7 @@
% if ctx.get('tracking'):
<ul>
% for tracking in ctx['tracking']
- <li>${tracking[0]} : ${tracking[1]} -> ${tracking[2]}</li>
+ <li>${tracking[0]} : ${tracking[1]} -&gt; ${tracking[2]}</li>
% endfor
</ul>
% endif
@@ -154,7 +155,8 @@
</tr></tbody>
</table>
</div>
-% endif]]></field>
+% endif
+]]></field>
</record>
</data>