[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.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user