[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.
This commit is contained in:
@@ -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 <name>_form_generate_values to update the tx dict with acqurier specific values
|
||||
|
||||
Reference in New Issue
Block a user