[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:
Toufik Benjaa
2018-07-11 14:15:55 +02:00
parent c8d283a592
commit 03d8f528b7
+1 -1
View File
@@ -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: