summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParth Choksi <pch@odoo.com>2019-04-26 09:58:59 +0000
committerParth Choksi <pch@odoo.com>2019-05-07 07:04:34 +0000
commit8776306e80639f5fd8a857e7b1fb0b6801040683 (patch)
treeedb6b57ddd14aa0db269c1bcbe59e05df4652ea7
parent52b49425250fa8cfa530818a226bb610de0d6f18 (diff)
[FIX] digest: using greaterthan and lessthan builtins
Before this commit, when you send a digest template to the user, the user would receive a blank mail(without any content). And while rendering the template we were getting the following error: jinja2.exceptions.TemplateSyntaxError: unexpected char '&' at 4039 This was due to the changes made in commit: https://github.com/odoo/odoo/commit/a7ac71ed4404aa2630619c331d725f4f545626f8#diff-705145eec648d5ef61b7b4060ae96b9dR8 In this instead of using CDATA, there was a change of the field type to 'html' and thus there were issues of parsing for jinja. Now after this commit, we will be using builtins of jinja: - 'greaterthan' instead of '>' - 'lessthan' instead of '<' Task-1918364
-rw-r--r--addons/digest/data/digest_template_data.xml12
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/digest/data/digest_template_data.xml b/addons/digest/data/digest_template_data.xml
index 72826734049..07c0994edaf 100644
--- a/addons/digest/data/digest_template_data.xml
+++ b/addons/digest/data/digest_template_data.xml
@@ -56,10 +56,10 @@
<span style="color: #888888; display: inline-block; font-size: 12px; line-height: 18px; text-transform: uppercase;">Yesterday</span>
% if data['yesterday'][kpi]['margin'] != 0.0:
<span style="color: #888888; display: block; font-size: 12px; line-height: 18px; text-transform: uppercase;">
- % if data['yesterday'][kpi]['margin'] &gt; 0.0:
+ % if data['yesterday'][kpi]['margin'] is greaterthan(0.0):
<span style="color: #0bbc22;">▲</span>${"%.2f" % data['yesterday'][kpi]['margin']} %
% endif
- % if data['yesterday'][kpi]['margin'] &lt; 0.0:
+ % if data['yesterday'][kpi]['margin'] is lessthan(0.0):
<span style="color: #ff0000;">▼</span>${"%.2f" % data['yesterday'][kpi]['margin']} %
% endif
</span>
@@ -76,10 +76,10 @@
<span style="color: #888888; display: inline-block; font-size: 12px; line-height: 18px; text-transform: uppercase;">Last 7 Days</span>
% if data['lastweek'][kpi]['margin'] != 0.0:
<span style="color: #888888; display: block; font-size: 12px; line-height: 18px; text-transform: uppercase;">
- % if data['lastweek'][kpi]['margin'] &gt; 0.0:
+ % if data['lastweek'][kpi]['margin'] is greaterthan(0.0):
<span style="color: #0bbc22;">▲</span>${"%.2f" % data['lastweek'][kpi]['margin']} %
% endif
- % if data['lastweek'][kpi]['margin'] &lt;0.0:
+ % if data['lastweek'][kpi]['margin'] is lessthan(0.0):
<span style="color: #ff0000;">▼</span>${"%.2f" % data['lastweek'][kpi]['margin']} %
%endif
</span>
@@ -96,10 +96,10 @@
<span style="color: #888888; display: inline-block; font-size: 12px; line-height: 18px; text-transform: uppercase;">Last 30 Days</span>
% if data['lastmonth'][kpi]['margin'] != 0.0:
<span style="color: #888888; display: block; font-size: 12px; line-height: 18px; text-transform: uppercase;">
- % if data['lastmonth'][kpi]['margin'] &gt; 0.0:
+ % if data['lastmonth'][kpi]['margin'] is greaterthan(0.0):
<span style="color: #0bbc22;">▲</span>${"%.2f" % data['lastmonth'][kpi]['margin']} %
% endif
- % if data['lastmonth'][kpi]['margin'] &lt; 0.0:
+ % if data['lastmonth'][kpi]['margin'] is lessthan(0.0):
<span style="color: #ff0000;">▼</span>${"%.2f" % data['lastmonth'][kpi]['margin']} %
%endif
</span>