From 711a8a82a3feea738eb6144e0a731dcf7077f182 Mon Sep 17 00:00:00 2001 From: Kirti Choudhary Date: Thu, 21 Jun 2018 14:35:03 +0530 Subject: [PATCH] [IMP] website_crm_partner_assign: make templates more modern and updated with Odoo guidelines In this commit we improve templates used in website_crm_partner_assign. 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 1841503 (and 1868112) and to PR #25388 (and #25889). --- .../data/crm_partner_assign_data.xml | 135 +++++++++++++----- 1 file changed, 101 insertions(+), 34 deletions(-) diff --git a/addons/website_crm_partner_assign/data/crm_partner_assign_data.xml b/addons/website_crm_partner_assign/data/crm_partner_assign_data.xml index 55c39a6fd10..7505007ac67 100644 --- a/addons/website_crm_partner_assign/data/crm_partner_assign_data.xml +++ b/addons/website_crm_partner_assign/data/crm_partner_assign_data.xml @@ -14,42 +14,109 @@ 4 - Lead Mass Mail + Lead Forward: Send to partner - - ${ctx['partner_id'].email|safe} - ${(user.email or '')|safe} Fwd: Lead: ${ctx['partner_id'].name} - Hello,

- - -

We have been contacted by those prospects that are in your region. Thus, the following leads have been assigned to ${ctx['partner_id'].name}:

- -
    -% for lead in ctx['partner_leads']: -
  1. ${lead.lead_id.name or 'Subject Undefined'}, ${lead.lead_id.partner_name or lead.lead_id.contact_name or 'Contact Name Undefined'}, ${lead.lead_id.country_id and lead.lead_id.country_id.name or 'Country Undefined' }, ${lead.lead_id.email_from or 'Email Undefined'}, ${lead.lead_id.phone or ''}

  2. -% endfor -
- -% if ctx.get('partner_in_portal'): -

Please connect to your Partner Portal to get details. On each lead are two buttons on the top left corner that you should press after having contacted the lead: "I'm interested" & "I'm not interested".

-% else: -

- You do not have yet a portal access to our database. Please contact - ${ctx['partner_id'].user_id and ctx['partner_id'].user_id.email and 'your account manager %s (%s)' % (ctx['partner_id'].user_id.name,ctx['partner_id'].user_id.email) or 'us'}. -

-% endif -

The lead will be sent to another partner if you do not contact the lead before 20 days.

- -

Thanks,

- -${ctx['partner_id'].user_id and ctx['partner_id'].user_id.signature | safe or ''} - -% if not ctx['partner_id'].user_id: -PS: It looks like you do not have an account manager assigned to you, please contact us. -% endif - ]]>
+ ${(user.email or '')|safe} + ${ctx['partner_id'].email|safe} + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+ Your leads
+
+ +
+
+
+
+ + + + + + + +
+
+ Hello,
+ We have been contacted by those prospects that are in your region. Thus, the following leads have been assigned to ${ctx['partner_id'].name}:
+
    + % for lead in ctx['partner_leads']: +
  1. ${lead.lead_id.name or 'Subject Undefined'}, ${lead.lead_id.partner_name or lead.lead_id.contact_name or 'Contact Name Undefined'}, ${lead.lead_id.country_id and lead.lead_id.country_id.name or 'Country Undefined' }, ${lead.lead_id.email_from or 'Email Undefined'}, ${lead.lead_id.phone or ''}

  2. + % endfor +
+ % if ctx.get('partner_in_portal'): + Please connect to your Partner Portal to get details. On each lead are two buttons on the top left corner that you should press after having contacted the lead: "I'm interested" & "I'm not interested".
+ % else: + You do not have yet a portal access to our database. Please contact + ${ctx['partner_id'].user_id and ctx['partner_id'].user_id.email and 'your account manager %s (%s)' % (ctx['partner_id'].user_id.name,ctx['partner_id'].user_id.email) or 'us'}.
+ % endif + The lead will be sent to another partner if you do not contact the lead before 20 days.

+ Thank you,
+ ${ctx['partner_id'].user_id and ctx['partner_id'].user_id.signature | safe or ''} +
+ % if not ctx['partner_id'].user_id: + PS: It looks like you do not have an account manager assigned to you, please contact us. + % endif +
+
+
+
+
+ + + +
+ ${user.company_id.name} +
+ ${user.company_id.phone} + % if user.company_id.phone and (user.company_id.email or user.company_id.website) + | + % endif + % if user.company_id.email + ${user.company_id.email} + % endif + % if user.company_id.email and user.company_id.website + | + % endif + % if user.company_id.website + + ${user.company_id.website} + + % endif +
+
+
+ + +
+ Powered by Odoo +
+
+
+