summaryrefslogtreecommitdiff
path: root/addons/delivery/data
diff options
context:
space:
mode:
authorMitali Patel <mpa@odoo.com>2018-06-18 18:15:53 +0530
committerThibault Delavallée <tde@odoo.com>2018-07-24 15:33:22 +0200
commitb26679ce16187db03f10e96cdb5ac7175b4398b4 (patch)
tree198c7bdb851bf925436c27e322e63f019e93dbe9 /addons/delivery/data
parent89152235177151a58bc54d0d70d96e421a252915 (diff)
[IMP] delivery: make templates more modern and updated with Odoo guidelines
In this commit we improve templates used in delivery. Purpose of this commit is to have templates that embed or use standard Odoo email layouts to make them look modern and have a common style across all emails. Main guidelines * better use of div / p / br to try to lessen layout issues, especially when updating templates using the editor; * correctly sequence the templates fields definition; * correctly set templates values notably auto_delete and user_signature fields to avoid confusion; * correctly layout the email content using light notification email. It can either propagate the layout choice through various send mail methods or directly embed the styling in the templates for more technical or complex templates; * use email_formatted computed field when possible to avoid having hand-made from / to addresses; * fix various typos and improve subjects when necessary; Content of emails is not necessarily updated as the purpose of this task is about styling, not content itself. This commit is linked to task ID 1843376 (and 1868112) and closes PR #25349 (and #25889).
Diffstat (limited to 'addons/delivery/data')
-rw-r--r--addons/delivery/data/mail_template_data.xml61
1 files changed, 35 insertions, 26 deletions
diff --git a/addons/delivery/data/mail_template_data.xml b/addons/delivery/data/mail_template_data.xml
index 14e566c5213..e8b6f08ebfc 100644
--- a/addons/delivery/data/mail_template_data.xml
+++ b/addons/delivery/data/mail_template_data.xml
@@ -1,30 +1,39 @@
<?xml version='1.0' encoding='utf-8'?>
-<odoo>
- <data noupdate="1">
+<odoo><data noupdate="1">
<record id="mail_template_data_delivery_confirmation" model="mail.template">
- <field name="name">Delivery: Send by Email</field>
- <field name="subject">${object.company_id.name} Delivery Order (Ref ${object.name or 'n/a' })</field>
- <field name="partner_to">${object.partner_id.id}</field>
- <field name="model_id" ref="delivery.model_stock_picking"/>
- <field name="report_template" ref="stock.action_report_delivery"/>
- <field name="report_name">${(object.name or '').replace('/','_')}</field>
- <field name="lang">${object.partner_id.lang}</field>
- <field name="body_html" type="xml">
-<p>Dear ${object.partner_id.name},</p>
-<p>We are glad to inform you that your order has been shipped.</p>
-<p>
-%if object.carrier_tracking_ref:
- Your tracking reference:
- %if object.carrier_tracking_url:
- <a href="${object.carrier_tracking_url}" target="_blank">${object.carrier_tracking_ref}</a>.
- %else:
- ${object.carrier_tracking_ref}.
- %endif
-%endif
-</p>
-<p>Find your delivery order attached for more details.</p>
-<p>Thank you,</p>
- </field>
+ <field name="name">Delivery: Send by Email</field>
+ <field name="model_id" ref="delivery.model_stock_picking"/>
+ <field name="subject">${object.company_id.name} Delivery Order (Ref ${object.name or 'n/a' })</field>
+ <field name="partner_to">${object.partner_id.id}</field>
+ <field name="body_html" type="html">
+<div style="margin: 0px; padding: 0px;">
+ <p style="margin: 0px; padding: 0px; font-size: 13px;">
+ Hello ${object.partner_id.name},<br/><br/>
+ We are glad to inform you that your order has been shipped.
+ %if object.carrier_tracking_ref:
+ Your tracking reference is
+ <strong>
+ %if object.carrier_tracking_url:
+ <a href="${object.carrier_tracking_url}" target="_blank">${object.carrier_tracking_ref}</a>.
+ %else:
+ ${object.carrier_tracking_ref}.
+ %endif
+ </strong>
+ %endif
+ <br/><br/>
+ Please find your delivery order attached for more details.<br/><br/>
+ Thank you,<br/>
+ % if user and user.signature:
+ ${user.signature | safe}
+ % endif
+ </p>
+</div>
+ </field>
+ <field name="report_template" ref="stock.action_report_delivery"/>
+ <field name="report_name">${(object.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>
- </data>
+</data>
</odoo>