From 0f5f960c60e9e4459aa2a710281f72e210f01d73 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 13 Jun 2016 14:21:59 +0200 Subject: [PATCH] [FIX] payment: render acquirer form values even if partner is missing When no `partner_id` was passed to `render()` and the acquirer had a fees computation method, (e.g. Paypal), it would crash. Could happen when coming through the /website_payment/pay controller, for instance. --- 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 bf83f8a4126..08d79b2756c 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -251,7 +251,7 @@ class PaymentAcquirer(osv.Model): # compute fees fees_method_name = '%s_compute_fees' % acquirer.provider if hasattr(self, fees_method_name): - fees = getattr(self, fees_method_name)(cr, uid, id, values['amount'], values['currency_id'], values['partner_country_id'], context=None) + fees = getattr(self, fees_method_name)(cr, uid, id, values['amount'], values['currency_id'], values.get('partner_country_id'), context=None) values['fees'] = float_round(fees, 2) # call _form_generate_values to update the tx dict with acqurier specific values