From f289c9ceef6f3f8cbae619b433d573a109855331 Mon Sep 17 00:00:00 2001 From: Toufik Ben Jaa Date: Fri, 30 Nov 2018 12:53:37 +0000 Subject: [PATCH] [FIX] payment: set correct payment communication - When a payment is done through a `payment.transaction` the communication should be the transaction's reference instead of its invoices reference. closes odoo/odoo#29187 --- addons/payment/models/payment_acquirer.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 8864a09d4f1..90d9177ff58 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -623,13 +623,6 @@ class PaymentTransaction(models.Model): @api.multi def _prepare_account_payment_vals(self): self.ensure_one() - - communication = [] - for invoice in self.invoice_ids: - inv_communication = invoice.type in ('in_invoice', 'in_refund') and invoice.reference or invoice.number - if invoice.origin: - communication.append('%s (%s)' % (inv_communication, invoice.origin)) - return { 'amount': self.amount, 'payment_type': 'inbound' if self.amount > 0 else 'outbound', @@ -642,7 +635,7 @@ class PaymentTransaction(models.Model): 'payment_method_id': self.env.ref('payment.account_payment_method_electronic_in').id, 'payment_token_id': self.payment_token_id and self.payment_token_id.id or None, 'payment_transaction_id': self.id, - 'communication': ' / '.join(communication), + 'communication': self.reference, } @api.multi