From c1f250d5b165ca1f1fcf1b9df56f5fd181ff1a91 Mon Sep 17 00:00:00 2001 From: Pratima Gupta Date: Mon, 18 Jun 2018 12:29:43 +0530 Subject: [PATCH] [IMP] repair: make templates more modern and updated with Odoo guidelines In this commit we improve templates used in repair. 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 1868112) and to PR #25294 (and #25889). --- addons/repair/data/repair_data.xml | 44 ++++++++++++++++-------------- addons/repair/models/repair.py | 3 +- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/addons/repair/data/repair_data.xml b/addons/repair/data/repair_data.xml index 4b62c7aacb9..136a20d0c82 100644 --- a/addons/repair/data/repair_data.xml +++ b/addons/repair/data/repair_data.xml @@ -1,31 +1,35 @@ - - - Repair Quotation - Send by Email - ${(object.create_uid.email and '%s <%s>' % (object.create_uid.name, object.create_uid.email) or '')|safe} - ${object.partner_id.name} Repair Orders (Ref ${object.name or 'n/a' }) - ${object.partner_id.id} + Repair Quotation: Send by email + ${object.partner_id.name} Repair Orders (Ref ${object.name or 'n/a' }) + ${(object.create_uid.email and '%s <%s>' % (object.create_uid.name, object.create_uid.email) or '')|safe} + ${object.partner_id.id} + +
+

+ Hello ${object.partner_id.name},
+ Here is your repair order ${doc_name} ${object.name} + % if object.origin: + (with reference: ${object.origin} ) + % endif + % if object.invoice_method != 'none': + amounting in ${format_amount(object.amount_total, object.pricelist_id.currency_id)}.
+ % else: + .
+ % endif + You can reply to this email if you have any questions. +

+ Thank you, +

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

Dear ${object.partner_id.name}

-

- Here is your repair order ${doc_name} ${object.name} - % if object.origin: - (with reference: ${object.origin} ) - % endif - % if object.invoice_method != 'none': - amounting in ${format_amount(object.amount_total, object.pricelist_id.currency_id)}. - % endif -

-

You can reply to this email if you have any questions.

-

Thank you,

-
+ +
diff --git a/addons/repair/models/repair.py b/addons/repair/models/repair.py index 95581a5e990..b0f188fd920 100644 --- a/addons/repair/models/repair.py +++ b/addons/repair/models/repair.py @@ -256,7 +256,8 @@ class Repair(models.Model): 'default_res_id': self.id, 'default_use_template': bool(template_id), 'default_template_id': template_id, - 'default_composition_mode': 'comment' + 'default_composition_mode': 'comment', + 'custom_layout': 'mail.mail_notification_light', } return { 'type': 'ir.actions.act_window',