diff options
| author | Toufik Ben Jaa <tbe@odoo.com> | 2018-11-30 12:53:37 +0000 |
|---|---|---|
| committer | Toufik Ben Jaa <tbe@odoo.com> | 2018-11-30 12:53:37 +0000 |
| commit | f289c9ceef6f3f8cbae619b433d573a109855331 (patch) | |
| tree | e27b5127894d84cec14b4ed04be7bb178c446280 | |
| parent | 6a71a680465916b97fd6f759491eb455de58af69 (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
| -rw-r--r-- | addons/payment/models/payment_acquirer.py | 9 |
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 |
