summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiral Bhavsar <hbh@odoo.com>2017-03-16 16:44:37 +0100
committerThibault Delavallée <tde@odoo.com>2017-05-15 14:17:19 +0200
commit5a6f03a1cef31c5ce13cbe7e7d1027a161ea4331 (patch)
treebd54f7f30d6c19c1dbc4057be2adb6fb8d5cf91f
parent29d927cfa3c65aec024c00462eb46237eb3167b0 (diff)
[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.
-rw-r--r--addons/sale/data/mail_template_data.xml6
1 files 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 @@
<p>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:
(<i>${object.partner_id.parent_id.name}</i>)