From 101bb927a070aaab1dba0c1e3d8500d43f97fe7f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 14 Oct 2015 13:26:48 +0200 Subject: [PATCH] [FIX] payment: fees computation depending on country The computed fees can depend on the country. There was a typo about it: there is no `country_id` field on the `payment.transaction` model, it's `partner_country_id`. Therefore, the computed fees according to the country were not always correctly computed. e.g. for Paypal, where the domestic fees are lower than the international fees, it always computed the fees as international. opw-651778 --- addons/payment/models/payment_acquirer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index eda0862bdfd..43ec6998b28 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -448,7 +448,7 @@ class PaymentTransaction(osv.Model): custom_method_name = '%s_compute_fees' % acquirer.provider if hasattr(Acquirer, custom_method_name): fees = getattr(Acquirer, custom_method_name)( - cr, uid, acquirer.id, values.get('amount', 0.0), values.get('currency_id'), values.get('country_id'), context=None) + cr, uid, acquirer.id, values.get('amount', 0.0), values.get('currency_id'), values.get('partner_country_id'), context=None) values['fees'] = float_round(fees, 2) # custom create