PURPOSE
Clean organization of templates in odoo apps: mail.template records in data,
qweb templates (views) used directly in code, notably using post with view.
Purpose is to ease future improvements in posting based on templates.
SPECIFICATIONS
* move those templates in their own file to ease their discovering and
maintenance;
* put them into data (as those are not views even if it contains qweb)
* guidelines are now :
-> Qweb templates should be in data/mail_templates.xml;
-> mail.template records should be in data/mail_template_data.xml;
* put their declaration in no update when not done if template has no
technical code or complex dependency on underlying code;
* move found mail data (mail.message.subtype or mail.activity.type) records
in a mail_data file that should contain only "core" records linked to mail;
LINKS
Task ID-2375767
COM PR odoo/odoo#61814
ENT PR odoo/enterprise#14775
UPG PR odoo/upgrade#1936
89 lines
3.8 KiB
XML
89 lines
3.8 KiB
XML
<?xml version="1.0" ?>
|
|
<odoo>
|
|
|
|
<!-- Mail template are declared in a NOUPDATE block
|
|
so users can freely customize/delete them -->
|
|
<data noupdate="1">
|
|
<!--Email template -->
|
|
<record id="email_template_edi_invoice" model="mail.template">
|
|
<field name="name">Invoice: Send by email</field>
|
|
<field name="model_id" ref="account.model_account_move"/>
|
|
<field name="email_from">${(object.invoice_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} Invoice (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;">
|
|
Dear
|
|
% if object.partner_id.parent_id:
|
|
${object.partner_id.name} (${object.partner_id.parent_id.name}),
|
|
% else:
|
|
${object.partner_id.name},
|
|
% endif
|
|
<br /><br />
|
|
Here is your
|
|
% if object.name:
|
|
invoice <strong>${object.name}</strong>
|
|
% else:
|
|
invoice
|
|
%endif
|
|
% if object.invoice_origin:
|
|
(with reference: ${object.invoice_origin})
|
|
% endif
|
|
amounting in <strong>${format_amount(object.amount_total, object.currency_id)}</strong>
|
|
from ${object.company_id.name}.
|
|
% if object.payment_state in ('paid', 'in_payment'):
|
|
This invoice is already paid.
|
|
% else:
|
|
Please remit payment at your earliest convenience.
|
|
% if object.payment_reference:
|
|
<br /><br />
|
|
Please use the following communication for your payment: <strong>${object.payment_reference}</strong>.
|
|
% endif
|
|
% endif
|
|
<br /><br />
|
|
Do not hesitate to contact us if you have any questions.
|
|
% if object.invoice_user_id.signature:
|
|
<br />
|
|
${object.invoice_user_id.signature | safe}
|
|
% endif
|
|
</p>
|
|
</div>
|
|
</field>
|
|
<field name="report_template" ref="account_invoices"/>
|
|
<field name="report_name">Invoice_${(object.name or '').replace('/','_')}${object.state == 'draft' and '_draft' or ''}</field>
|
|
<field name="lang">${object.partner_id.lang}</field>
|
|
<field name="auto_delete" eval="True"/>
|
|
</record>
|
|
|
|
<record id="mail_template_data_payment_receipt" model="mail.template">
|
|
<field name="name">Payment Receipt: Send by email</field>
|
|
<field name="model_id" ref="account.model_account_payment"/>
|
|
<field name="subject">${object.company_id.name} Payment Receipt (Ref ${object.name or 'n/a' })</field>
|
|
<field name="partner_to">${object.partner_id.id}</field>
|
|
<field name="body_html" type="xml">
|
|
<div style="margin: 0px; padding: 0px;">
|
|
<p style="margin: 0px; padding: 0px; font-size: 13px;">
|
|
Dear ${object.partner_id.name}<br/><br/>
|
|
Thank you for your payment.
|
|
Here is your payment receipt <strong>${(object.name or '').replace('/','-')}</strong> amounting
|
|
to <strong>${format_amount(object.amount, object.currency_id)}</strong> from ${object.company_id.name}.
|
|
<br /><br />
|
|
Do not hesitate to contact us if you have any questions.
|
|
<br/><br/>
|
|
Best regards,
|
|
% if user.signature:
|
|
<br/>
|
|
${user.signature | safe}
|
|
% endif
|
|
</p>
|
|
</div>
|
|
</field>
|
|
<field name="report_template" ref="account.action_report_payment_receipt"/>
|
|
<field name="report_name">${(object.name or '').replace('/','-')}</field>
|
|
<field name="lang">${object.partner_id.lang}</field>
|
|
<field name="auto_delete" eval="True"/>
|
|
</record>
|
|
</data>
|
|
</odoo>
|