From 03d8f528b707650359048eeaf87da7c207943df7 Mon Sep 17 00:00:00 2001 From: Toufik Benjaa Date: Wed, 11 Jul 2018 14:15:55 +0200 Subject: [PATCH] [FIX] payment: Avoid accessing a field on an integer - When clicking on the invoices stat button on payment transactions via the form view a traceback is displayed. This is due to the fact that the code is trying to access to a member/field named "id" on an integer. "invoice" is an integer, not a record/object. --- 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 3e701e981d3..3d11e31db0a 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -806,7 +806,7 @@ class PaymentTransaction(models.Model): invoice_ids = self.invoice_ids.ids if len(invoice_ids) == 1: invoice = invoice_ids[0] - action['res_id'] = invoice.id + action['res_id'] = invoice action['view_mode'] = 'form' action['views'] = [(self.env.ref('account.invoice_form').id, 'form')] else: