From dd18811e6c467785eedc4f171619e4fe3a444e62 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 20 Apr 2018 13:18:55 +0200 Subject: [PATCH] [FIX] purchase: use PO company for PO notification In 41ffb503 the "Invoice Notification Email" and "Sale Order Notification Email" were modified so the company used was the one of the object if available or the sender otherwise. This had not been done for the "Purchase Order Notification Email" which was added in saas-14 which might be unexpected. Also as in 7a03f9ce9 specify the company when displaying the logo. opw-1838112 closes #24344 --- addons/purchase/data/mail_template_data.xml | 18 ++++++++++-------- addons/purchase/i18n/purchase.pot | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/addons/purchase/data/mail_template_data.xml b/addons/purchase/data/mail_template_data.xml index 35445697973..787f71cbe70 100644 --- a/addons/purchase/data/mail_template_data.xml +++ b/addons/purchase/data/mail_template_data.xml @@ -86,6 +86,8 @@ from ${object.company_id.name}. + % set record = ctx.get('record') + % set company = record and record.company_id or user.company_id @@ -101,7 +103,7 @@ from ${object.company_id.name}.
- ${user.company_id.name} + ${company.name}
@@ -127,16 +129,16 @@ from ${object.company_id.name}. diff --git a/addons/purchase/i18n/purchase.pot b/addons/purchase/i18n/purchase.pot index 65317141e08..ce54f7f4f86 100644 --- a/addons/purchase/i18n/purchase.pot +++ b/addons/purchase/i18n/purchase.pot @@ -118,6 +118,8 @@ msgstr "" #: model:mail.template,body_html:purchase.mail_template_data_notification_email_purchase_order msgid "\n" " \n" +" % set record = ctx.get('record')\n" +" % set company = record and record.company_id or user.company_id\n" " \n" "
- ${user.company_id.name}
- ${user.company_id.phone or ''} + ${company.name}
+ ${company.phone or ''}
- % if user.company_id.email: - ${user.company_id.email}
+ % if company.email: + ${company.email}
% endif - % if user.company_id.website: - - ${user.company_id.website} + % if company.website: + + ${company.website} % endif
\n" " \n" @@ -133,7 +135,7 @@ msgid "\n" " \n" " \n" " \n" " \n" "
\n" -" \"${user.company_id.name}\"\n" +" \"${company.name}\"\n" "
\n" @@ -159,16 +161,16 @@ msgid "\n" " \n" " \n" " \n" " \n"
\n" -" ${user.company_id.name}
\n" -" ${user.company_id.phone or ''}\n" +" ${company.name}
\n" +" ${company.phone or ''}\n" "
\n" -" % if user.company_id.email:\n" -" ${user.company_id.email}
\n" +" % if company.email:\n" +" ${company.email}
\n" " % endif\n" -" % if user.company_id.website:\n" -" \n" -" ${user.company_id.website}\n" +" % if company.website:\n" +" \n" +" ${company.website}\n" " \n" " % endif\n" "