summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2016-07-12 15:47:45 +0200
committerGoffin Simon <sig@odoo.com>2016-07-26 15:59:55 +0200
commitdbf44a968016c5cd9836686e75224c805f9d104f (patch)
tree8bb0eebc97b1cc4bdd959ac8e3811a24e4897d16
parent245e38d242f90f6eebaa4bebd745140de7dd48a1 (diff)
[FIX] payment_paypal: country and state code required for paypal
As explained in: -https://developer.paypal.com/docs/classic/api/country_codes/ -https://developer.paypal.com/docs/classic/api/state_codes/ The country and state code is required to create a paypal transaction. But in some cases, the complete name of the state/province is required. For example, for India, sometimes the complete name of the state is required. Check the list of those state/province in the documentation. Hint: form_preprocess_values opw:682872
-rw-r--r--addons/payment_paypal/models/paypal.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/payment_paypal/models/paypal.py b/addons/payment_paypal/models/paypal.py
index fa9c4e7a660..d66b55add50 100644
--- a/addons/payment_paypal/models/paypal.py
+++ b/addons/payment_paypal/models/paypal.py
@@ -119,8 +119,8 @@ class AcquirerPaypal(osv.Model):
'currency_code': tx_values['currency'] and tx_values['currency'].name or '',
'address1': partner_values['address'],
'city': partner_values['city'],
- 'country': partner_values['country'] and partner_values['country'].name or '',
- 'state': partner_values['state'] and partner_values['state'].name or '',
+ 'country': partner_values['country'] and partner_values['country'].code or '',
+ 'state': partner_values['state'] and (partner_values['state'].code or partner_values['state'].name) or '',
'email': partner_values['email'],
'zip': partner_values['zip'],
'first_name': partner_values['first_name'],