From 0d83edc9b022c8895b6684a306408ed401ccffac Mon Sep 17 00:00:00 2001 From: Pratima Gupta Date: Mon, 18 Jun 2018 12:07:54 +0530 Subject: [PATCH] [IMP] account, l10n_be_invoice: make templates more modern and updated with Odoo guidelines In this commit we improve templates used in account and l10n_be. 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 1843395 and 1843376 (and 1868112) and to PR #25294 and #25349 (and #25889). Co-Authored-By: Mitali Patel --- addons/account/data/payment_receipt_data.xml | 35 +++++---- .../data/mail_template_data.xml | 72 ++++++++----------- 2 files changed, 53 insertions(+), 54 deletions(-) diff --git a/addons/account/data/payment_receipt_data.xml b/addons/account/data/payment_receipt_data.xml index d3c02413732..e05a711ece0 100644 --- a/addons/account/data/payment_receipt_data.xml +++ b/addons/account/data/payment_receipt_data.xml @@ -4,24 +4,32 @@ - Payment Receipt - Send by Email + Payment Receipt: Send by email + ${object.company_id.name} Payment Receipt (Ref ${object.name or 'n/a' }) ${object.partner_id.id} - - + +
+

+ Dear ${object.partner_id.name}

+ Thank you for your payment. + Here is your payment receipt ${(object.name or '').replace('/','-')} amounting + to ${format_amount(object.amount, object.currency_id)} from ${object.company_id.name}. +

+ Do not hesitate to contact us if you have any question. +

+ Best regards,
+ % if user and user.signature: + ${user.signature | safe} + % endif +

+
+
${(object.name or '').replace('/','-')} ${object.partner_id.lang} - -

Dear ${object.partner_id.name},

-

Thank you for your payment.
Here is your payment receipt ${(object.name or '').replace('/','-')} amounting to ${format_amount(object.amount, object.currency_id)} from ${object.company_id.name}.

-

If you have any questions, please do not hesitate to contact us.

-

Best regards, -% if user and user.signature: -${user.signature | safe} -% endif -

-
+ +
diff --git a/addons/l10n_be_invoice_bba/data/mail_template_data.xml b/addons/l10n_be_invoice_bba/data/mail_template_data.xml index b7110f157e7..e12f7745b91 100644 --- a/addons/l10n_be_invoice_bba/data/mail_template_data.xml +++ b/addons/l10n_be_invoice_bba/data/mail_template_data.xml @@ -2,47 +2,37 @@ - Dear ${object.partner_id.name} -% set access_action = object.with_context(force_website=True).get_access_action() -% set is_online = access_action and access_action['type'] == 'ir.actions.act_url' -% set access_url = is_online and object.get_mail_url() or '/report/pdf/account.report_invoice/' + str(object.id) - -% if object.partner_id.parent_id: - (${object.partner_id.parent_id.name}) -% endif -,

-

Here is your -% if object.number: -invoice ${object.number} -% else: -pro-forma invoice -% endif -% if object.origin: -(with reference: ${object.origin} ) -% endif -amounting in ${format_amount(object.amount_total, object.currency_id)} -from ${object.company_id.name}. -

- -% if is_online: -

-
- View Invoice -
-% endif -

- -% if object.reference_type=='bba' and object.reference: -

Please use the following communication for your payment : ${object.reference}

-% endif - -

Please remit payment at your earliest convenience.

-

Thank you,

-% if object.user_id and object.user_id.signature: - ${object.user_id.signature | safe} -% endif -]]>
+ +
+

+ Dear ${object.partner_id.name} + % if object.partner_id.parent_id: + (${object.partner_id.parent_id.name}) + % endif +

+ Here is, in attachment, your + % if object.number: + invoice ${object.number} + % else: + invoice + %endif + % if object.origin: + (with reference: ${object.origin} ) + % endif + amounting in ${format_amount(object.amount_total, object.currency_id)} + from ${object.company_id.name}. + % if object.state=='paid': + This invoice is already paid. + % else: + Please remit payment at your earliest convenience. + % if object.reference_type == 'bba' and object.reference: + Please use the following communication for your payment: ${object.reference}. + % endif +

+ Do not hesitate to contact us if you have any question. +

+
+