[FIX] account: add the payment reference on the payment

OPW 2082843
The communication on the register payment took the vendor reference or
the invoice name by default. Now, it first looks at the payment reference
value.

closes odoo/odoo#38683

X-original-commit: 6e1a821818e478c49407474446b2e0a521889194
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit is contained in:
wan
2019-10-14 09:08:36 +00:00
committed by fw-bot
parent 53bb4582d2
commit 3fe24ac5e7
+2 -2
View File
@@ -121,7 +121,7 @@ class account_payment(models.Model):
'payment_type': 'inbound' if amount > 0 else 'outbound',
'partner_id': invoices[0].commercial_partner_id.id,
'partner_type': MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type],
'communication': invoices[0].ref or invoices[0].name,
'communication': invoices[0].invoice_payment_ref or invoices[0].ref or invoices[0].name,
'invoice_ids': [(6, 0, invoices.ids)],
})
return rec
@@ -782,7 +782,7 @@ class payment_register(models.TransientModel):
'journal_id': self.journal_id.id,
'payment_method_id': self.payment_method_id.id,
'payment_date': self.payment_date,
'communication': " ".join(i.ref or i.name for i in invoices),
'communication': " ".join(i.invoice_payment_ref or i.ref or i.name for i in invoices),
'invoice_ids': [(6, 0, invoices.ids)],
'payment_type': ('inbound' if amount > 0 else 'outbound'),
'amount': abs(amount),