From 5a6f03a1cef31c5ce13cbe7e7d1027a161ea4331 Mon Sep 17 00:00:00 2001 From: Hiral Bhavsar Date: Thu, 16 Mar 2017 16:44:37 +0100 Subject: [PATCH] [IMP] sale, website_quote: improve wording in sent emails Correctly display 'Pay online' or 'View online' depending on payment required option. Also correctly set the URL that comes from the get_access_action method. --- addons/sale/data/mail_template_data.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/sale/data/mail_template_data.xml b/addons/sale/data/mail_template_data.xml index f7a61b7a391..5970e897acb 100644 --- a/addons/sale/data/mail_template_data.xml +++ b/addons/sale/data/mail_template_data.xml @@ -17,9 +17,9 @@

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 doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order confirmation' -% set access_name = is_online and object.template_id and doc_name == 'quotation' and 'Accept and pay %s online' % doc_name or 'View %s' % doc_name -% set access_url = is_online and '/mail/view?model=sale.order&res_id=%d' % (object.id) or '' +% set pay_sign_name = ('require_payment' in object and object.require_payment and 'pay') or 'sign' +% set access_name = is_online and object.template_id and object.state in ('draft', 'sent') and 'Accept and %s online' % pay_sign_name or 'View %s' % doc_name +% set access_url = is_online and access_action['url'] or '' % if object.partner_id.parent_id: (${object.partner_id.parent_id.name})