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).
40 lines
1.6 KiB
XML
40 lines
1.6 KiB
XML
<?xml version='1.0' encoding='utf-8'?>
|
|
<odoo><data noupdate="1">
|
|
<record id="mail_template_data_delivery_confirmation" model="mail.template">
|
|
<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>
|
|
</odoo>
|