diff --git a/addons/account/edi/invoice_action_data.xml b/addons/account/edi/invoice_action_data.xml
index bdb08d66cfe..36bb31b1db3 100644
--- a/addons/account/edi/invoice_action_data.xml
+++ b/addons/account/edi/invoice_action_data.xml
@@ -22,7 +22,7 @@
Invoice - Send by Email
- ${object.user_id.email or object.company_id.email or 'noreply@localhost'|safe}
+ ${object.user_id.email or object.company_id.email or 'noreply@localhost'}
${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})
${object.partner_id.id}
@@ -46,32 +46,27 @@
Order reference: ${object.origin}
% endif
% if object.user_id:
- Your contact: ${object.user_id.name}
+ Your contact: ${object.user_id.name}
% endif
% if object.company_id.paypal_account and object.type in ('out_invoice'):
- <% set paypal_url = (
- "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick"
- "&business=%(paypal_account)s"
- "&item_name=%(company_name)s%%20Invoice%%20%(inv)s"
- "&invoice=%(inv)s"
- "&amount=%(amount)s"
- "¤cy_code=%(currency)s"
- "&button_subtype=services"
- "&no_note=1"
- "&bn=OpenERP_Invoice_PayNow_%(currency)s"
- % {
- 'paypal_account': quote(object.company_id.paypal_account),
- 'company_name': quote(object.company_id.name),
- 'inv': quote(object.number),
- 'amount': quote(str(object.residual)),
- 'currency': quote(object.currency_id.name),
+ <% set paypal_url = "https://www.paypal.com/cgi-bin/webscr?" +
+ urlencode({
+ "cmd": "_xclick",
+ "business": object.company_id.paypal_account,
+ "item_name": object.company_id.name + " Invoice " + object.number,
+ "invoice": object.number,
+ "amount": object.residual,
+ "currency_code": object.currency_id.name,
+ "button_subtype": "services",
+ "no_note": "1",
+ "bn": "OpenERP_Invoice_PayNow_" + object.currency_id.name,
})
%>
It is also possible to directly pay with Paypal:
-
+
% endif
@@ -107,7 +102,7 @@
% endif
% if object.company_id.website:
%endif
diff --git a/addons/account_followup/account_followup_data.xml b/addons/account_followup/account_followup_data.xml
index d5b257a052f..c35a0ffcd49 100644
--- a/addons/account_followup/account_followup_data.xml
+++ b/addons/account_followup/account_followup_data.xml
@@ -6,9 +6,9 @@
First polite payment follow-up reminder email
- ${user.email or ''|safe}
+ ${user.email or ''}
${user.company_id.name} Payment Reminder
- ${object.email|safe}
+ ${object.email}
${object.lang}
@@ -45,9 +45,9 @@ ${ctx.get('followup_table','') | safe}
A bit urging second payment follow-up reminder email
- ${user.email or ''|safe}
+ ${user.email or ''}
${user.company_id.name} Payment Reminder
- ${object.email|safe}
+ ${object.email}
${object.lang}
@@ -85,9 +85,9 @@ ${ctx.get('followup_table','') | safe}
Urging payment follow-up reminder email
- ${user.email or ''|safe}
+ ${user.email or ''}
${user.company_id.name} Payment Reminder
- ${object.email|safe}
+ ${object.email}
${object.lang}
@@ -122,9 +122,9 @@ ${ctx.get('followup_table','') | safe}
Default payment follow-up reminder e-mail
- ${user.email or ''|safe}
+ ${user.email or ''}
${user.company_id.name} Payment Reminder
- ${object.email|safe}
+ ${object.email}
${object.lang}
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
index e4cbc20f8f6..619569f4c81 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -28,7 +28,7 @@ from osv import osv
from osv import fields
import tools
from tools.translate import _
-from urllib import quote as quote
+from urllib import quote, urlencode
_logger = logging.getLogger(__name__)
@@ -56,6 +56,7 @@ try:
mako_template_env.globals.update({
'str': str,
'quote': quote,
+ 'urlencode': urlencode,
})
except ImportError:
_logger.warning("jinja2 not available, templating features will not work!")
diff --git a/addons/portal_sale/portal_sale_data.xml b/addons/portal_sale/portal_sale_data.xml
index bdf51fd2fe7..60f11a5f767 100644
--- a/addons/portal_sale/portal_sale_data.xml
+++ b/addons/portal_sale/portal_sale_data.xml
@@ -6,7 +6,7 @@
Sale Order - Send by Email (Portal)
- ${object.user_id.email or ''|safe}
+ ${object.user_id.email or ''}
${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })
${object.partner_invoice_id.id}
@@ -32,7 +32,7 @@
Your reference: ${object.client_order_ref}
% endif
% if object.user_id:
- Your contact: ${object.user_id.name}
+ Your contact: ${object.user_id.name}
% endif
@@ -42,30 +42,26 @@
You can access this document and pay online via our Customer Portal:
View ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'}
+ href="${signup_url}">View ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'}
% endif
% if object.order_policy in ('prepaid','manual') and object.company_id.paypal_account and object.state != 'draft':
- <% set paypal_url = ("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick"
- "&business=%(paypal_account)s"
- "&item_name=%(company_name)s%%20Order%%20%(order_name)s"
- "&invoice=%(order_name)s"
- "&amount=%(order_amount)s"
- "¤cy_code=%(currency)s"
- "&button_subtype=services"
- "&no_note=1"
- "&bn=OpenERP_Order_PayNow_%(currency)s"
- % {
- 'paypal_account': quote(object.company_id.paypal_account),
- 'company_name': quote(object.company_id.name),
- 'order_name': quote(object.name),
- 'order_amount': quote(str(object.residual)),
- 'currency': quote(object.pricelist_id.currency_id.name),
+ <% set paypal_url = "https://www.paypal.com/cgi-bin/webscr?" +
+ urlencode({
+ "cmd": "_xclick",
+ "business": object.company_id.paypal_account,
+ "item_name": object.company_id.name + " Order " + object.name,
+ "invoice": object.name,
+ "amount": object.amount_total,
+ "currency_code": object.pricelist_id.currency_id.name,
+ "button_subtype": "services",
+ "no_note": "1",
+ "bn": "OpenERP_Order_PayNow_" + object.pricelist_id.currency_id.name,
})
%>
It is also possible to directly pay with Paypal:
-
+
% endif
@@ -101,7 +97,7 @@
% endif
% if object.company_id.website:
% endif
@@ -112,7 +108,7 @@
Invoice - Send by Email (Portal)
- ${object.user_id.email or object.company_id.email or 'noreply@localhost'|safe}
+ ${object.user_id.email or object.company_id.email or 'noreply@localhost'}
${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })
${object.partner_id.id}
@@ -135,7 +131,7 @@
Order reference: ${object.origin}
% endif
% if object.user_id:
- Your contact: ${object.user_id.name}
+ Your contact: ${object.user_id.name}
% endif
@@ -149,26 +145,22 @@
% endif
% if object.company_id.paypal_account and object.type in ('out_invoice'):
- <% set paypal_url = ("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick"
- "&business=%(paypal_account)s"
- "&item_name=%(company_name)s%%20Invoice%%20%(inv)s"
- "&invoice=%(inv)s"
- "&amount=%(amount)s"
- "¤cy_code=%(currency)s"
- "&button_subtype=services"
- "&no_note=1"
- "&bn=OpenERP_Invoice_PayNow_%(currency)s"
- % {
- 'paypal_account': quote(object.company_id.paypal_account),
- 'company_name': quote(object.company_id.name),
- 'inv': quote(object.number),
- 'amount': quote(str(object.residual)),
- 'currency': quote(object.currency_id.name),
+ <% set paypal_url = "https://www.paypal.com/cgi-bin/webscr?" +
+ urlencode({
+ "cmd": "_xclick",
+ "business": object.company_id.paypal_account,
+ "item_name": object.company_id.name + " Invoice " + object.number,
+ "invoice": object.number,
+ "amount": object.residual,
+ "currency_code": object.currency_id.name,
+ "button_subtype": "services",
+ "no_note": "1",
+ "bn": "OpenERP_Invoice_PayNow_" + object.currency_id.name,
})
%>
It is also possible to directly pay with Paypal:
-
+
% endif
@@ -204,7 +196,7 @@
% endif
% if object.company_id.website:
% endif
diff --git a/addons/purchase/edi/purchase_order_action_data.xml b/addons/purchase/edi/purchase_order_action_data.xml
index f861c025ae8..06a68aaab83 100644
--- a/addons/purchase/edi/purchase_order_action_data.xml
+++ b/addons/purchase/edi/purchase_order_action_data.xml
@@ -19,7 +19,7 @@
Purchase Order - Send by mail
- ${object.validator.email or ''|safe}
+ ${object.validator.email or ''}
${object.company_id.name} Order (Ref ${object.name or 'n/a' })
${object.partner_id.id}
@@ -46,7 +46,7 @@
Your reference: ${object.partner_ref}
% endif
% if object.validator:
- Your contact: ${object.validator.name}
+ Your contact: ${object.validator.name}
% endif
@@ -81,7 +81,7 @@
% endif
% if object.company_id.website:
%endif
diff --git a/addons/sale/edi/sale_order_action_data.xml b/addons/sale/edi/sale_order_action_data.xml
index 2a2061f1e6b..eebb63fb624 100644
--- a/addons/sale/edi/sale_order_action_data.xml
+++ b/addons/sale/edi/sale_order_action_data.xml
@@ -21,7 +21,7 @@
Sale Order - Send by Email
- ${object.user_id.email or ''|safe}
+ ${object.user_id.email or ''}
${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })
${object.partner_invoice_id.id}
@@ -48,31 +48,27 @@
Your reference: ${object.client_order_ref}
% endif
% if object.user_id:
- Your contact: ${object.user_id.name}
+ Your contact: ${object.user_id.name}
% endif
% if object.order_policy in ('prepaid','manual') and object.company_id.paypal_account and object.state != 'draft':
- <% set paypal_url = ("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick"
- "&business=%(paypal_account)s"
- "&item_name=%(company_name)s%%20Order%%20%(order_name)s"
- "&invoice=%(order_name)s"
- "&amount=%(order_amount)s"
- "¤cy_code=%(currency)s"
- "&button_subtype=services"
- "&no_note=1"
- "&bn=OpenERP_Order_PayNow_%(currency)s"
- % {
- 'paypal_account': quote(object.company_id.paypal_account),
- 'company_name': quote(object.company_id.name),
- 'order_name': quote(object.name),
- 'order_amount': quote(str(object.amount_total)),
- 'currency': quote(object.pricelist_id.currency_id.name),
+ <% set paypal_url = "https://www.paypal.com/cgi-bin/webscr?" +
+ urlencode({
+ "cmd": "_xclick",
+ "business": object.company_id.paypal_account,
+ "item_name": object.company_id.name + " Order " + object.name,
+ "invoice": object.name,
+ "amount": object.amount_total,
+ "currency_code": object.pricelist_id.currency_id.name,
+ "button_subtype": "services",
+ "no_note": "1",
+ "bn": "OpenERP_Order_PayNow_" + object.pricelist_id.currency_id.name,
})
%>
It is also possible to directly pay with Paypal:
-
+
% endif
@@ -108,7 +104,7 @@
% endif
% if object.company_id.website:
%endif