diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index e521a773a9c..70773401d7e 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -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),