summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorToufik Ben Jaa <tbe@odoo.com>2018-11-30 12:53:37 +0000
committerToufik Ben Jaa <tbe@odoo.com>2018-11-30 12:53:37 +0000
commitf289c9ceef6f3f8cbae619b433d573a109855331 (patch)
treee27b5127894d84cec14b4ed04be7bb178c446280 /addons
parent6a71a680465916b97fd6f759491eb455de58af69 (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/payment/models/payment_acquirer.py9
1 files changed, 1 insertions, 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