Skip to content
Permalink
Browse files

[FIX][IMP] various: perform small cleanup of mail templates

Notably
 * remove cdata and fix html code when necessary;
 * re-order fields declaration to have globally the same order in various
   template definition;
 * remove unnecessary reply-to, make user signature and auto delete fields
   explicit when necessary;

Related to task 1972615
Linked to PR #32872
  • Loading branch information...
tde-banana-odoo committed Apr 23, 2019
1 parent 23a26ff commit 1162b2edf1b34d7f2a20ef96ad4f1bfdfa3fe7d3
@@ -7,16 +7,14 @@
<field name="email_to">iap@odoo.com</field>
<field name="subject">IAP Lead Generation Notification</field>
<field name="model_id" ref="iap.model_iap_account"/>
<field name="body_html">
<![CDATA[
<p>Dear,</p>
<p>There is no more credits on your IAP Lead Generation account.<br/>
You can charge your IAP Lead Generation account in the settings of the CRM app.<br/>
<p>Best regards,</p>
<p>Odoo S.A.</p>
]]>
</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p>Dear,</p>
<p>There is no more credits on your IAP Lead Generation account.<br/>
You can charge your IAP Lead Generation account in the settings of the CRM app.<br/></p>
<p>Best regards,</p>
<p>Odoo S.A.</p>
</div></field>
</record>
</data>
</odoo>
@@ -3,10 +3,9 @@
<record id="digest_mail_template" model="mail.template">
<field name="name">Digest: Default main template</field>
<field name="model_id" ref="digest.model_digest_digest"/>
<field name="auto_delete" eval="True" />
<field name="email_from">${user.email_formatted | safe}</field>
<field name="lang">${user.lang}</field>
<field name="body_html"><![CDATA[
<field name="subject">${'%s: %s' % (ctx.get('user', user).company_id.name, object.name)}</field>
<field name="body_html" type="html">
<table style="width: 100%; border-spacing: 0; font-family: Helvetica,Arial,Verdana,sans-serif;">
<tr>
<td align="center" valign="top" style="border-collapse: collapse; padding: 0">
@@ -54,10 +53,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'] > 0.0:
% if data['yesterday'][kpi]['margin'] &gt; 0.0:
<span style="color: #0bbc22;">▲</span>${"%.2f" % data['yesterday'][kpi]['margin']} %
% endif
% if data['yesterday'][kpi]['margin'] < 0.0:
% if data['yesterday'][kpi]['margin'] &lt; 0.0:
<span style="color: #ff0000;">▼</span>${"%.2f" % data['yesterday'][kpi]['margin']} %
% endif
</span>
@@ -74,10 +73,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'] > 0.0:
% if data['lastweek'][kpi]['margin'] &gt; 0.0:
<span style="color: #0bbc22;">▲</span>${"%.2f" % data['lastweek'][kpi]['margin']} %
% endif
% if data['lastweek'][kpi]['margin'] < 0.0:
% if data['lastweek'][kpi]['margin'] &lt;0.0:
<span style="color: #ff0000;">▼</span>${"%.2f" % data['lastweek'][kpi]['margin']} %
%endif
</span>
@@ -94,10 +93,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'] > 0.0:
% if data['lastmonth'][kpi]['margin'] &gt; 0.0:
<span style="color: #0bbc22;">▲</span>${"%.2f" % data['lastmonth'][kpi]['margin']} %
% endif
% if data['lastmonth'][kpi]['margin'] < 0.0:
% if data['lastmonth'][kpi]['margin'] &lt; 0.0:
<span style="color: #ff0000;">▼</span>${"%.2f" % data['lastmonth'][kpi]['margin']} %
%endif
</span>
@@ -155,7 +154,9 @@
</table>
</td>
</tr>
</table>
]]></field>
</table></field>
<field name="lang">${user.lang}</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
</odoo>
@@ -24,6 +24,7 @@
<field name="report_name">badge_of_${(object.event_id.name or '').replace('/','_')}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>

<record id="event_subscription" model="mail.template">
@@ -32,7 +33,6 @@
<field name="subject">Your registration at ${object.event_id.name}</field>
<field name="email_from">${(object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') | safe}</field>
<field name="email_to">${(object.partner_id.email_formatted or '"%s" &lt;%s&gt;' % (object.name, object.email) or '') | safe}</field>
<field name="reply_to" eval="False"/>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
% set date_begin = format_tz(object.event_id.date_begin, tz='UTC', format='%Y%m%dT%H%M%SZ')
@@ -221,6 +221,7 @@
</table>
</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="user_signature" eval="False"/>
</record>

<record id="event_reminder" model="mail.template">
@@ -229,7 +230,6 @@
<field name="subject">${object.event_id.name}: ${object.get_date_range_str()}</field>
<field name="email_from">${(object.event_id.organizer_id.email_formatted or object.event_id.user_id.email_formatted or '') | safe}</field>
<field name="email_to">${(object.partner_id.email_formatted or '"%s" &lt;%s&gt;' % (object.name, object.email) or '') | safe}</field>
<field name="reply_to" eval="False"/>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
% set date_begin = format_tz(object.event_id.date_begin, tz='UTC', format='%Y%m%dT%H%M%SZ')
@@ -418,6 +418,7 @@
</table>
</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="user_signature" eval="False"/>
</record>

</data>
@@ -37,7 +37,6 @@
<field name="subject">New badge ${object.badge_id.name} granted</field>
<field name="model_id" ref="gamification.model_gamification_badge_user"/>
<field name="partner_to">${object.user_id.partner_id.id}</field>
<field name="lang">${object.user_id.lang}</field>
<field name="body_html" type="xml">
<table border="0" cellpadding="0" style="padding-top: 16px; background-color: #F1F1F1; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" width="590" cellpadding="0" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;" summary="o_mail_notification">
@@ -134,10 +133,10 @@
</td></tr>
</table>
</td></tr>
</table>


</field>
</table></field>
<field name="lang">${object.user_id.lang}</field>
<field name="user_signature" eval="False"/>
<field name="auto_delete" eval="True"/>
</record>
</data>
</odoo>
@@ -7,7 +7,6 @@
<record id="email_template_goal_reminder" model="mail.template">
<field name="name">Reminder for Goal Update</field>
<field name="model_id" ref="gamification.model_gamification_goal"/>
<field name="lang">${object.user_id.lang}</field>
<field name="body_html" type="html">
<div>
<strong>Reminder ${object.name}</strong><br/>
@@ -19,6 +18,9 @@ Thank you,
${object.challenge_id.manager_id.signature | safe}
% endif
</div></field>
<field name="lang">${object.user_id.lang}</field>
<field name="user_signature" eval="False"/>
<field name="auto_delete" eval="True"/>
</record>

<record id="simple_report_template" model="mail.template">
@@ -64,8 +64,9 @@
<record id="email_template_partner" model="mail.template">
<field name="name">Partner Mass Mail</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="auto_delete" eval="True"/>
<field name="partner_to">${object.id}</field>
<field name="user_signature" eval="True"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.lang}</field>
</record>

@@ -73,9 +73,9 @@
<record id="email_template_edi_sale" model="mail.template">
<field name="name">Sales Order: Send by email</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
<field name="email_from">${(object.user_id.email_formatted or user.email_formatted) | safe}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
@@ -84,9 +84,9 @@
</field>
<field name="report_template" ref="report_coupon_code"/>
<field name="report_name">Your Coupon Code</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
<field name="lang">${object.partner_id.lang}</field>
</record>
</data>
</odoo>
@@ -118,6 +118,7 @@
</field>
<field name="lang">${ctx['partner_id'].lang}</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
</data>

@@ -102,6 +102,8 @@
</table>
</field>
<field name="lang">${object.lang}</field>
<field name="user_signature" eval="False"/>
<field name="auto_delete" eval="True"/>
</record>
</data>
</odoo>

0 comments on commit 1162b2e

Please sign in to comment.
You can’t perform that action at this time.