From 3db051e7f552b366c9169b3966365f7ea30cc606 Mon Sep 17 00:00:00 2001 From: Horacio Tellez Date: Fri, 3 Dec 2021 12:55:01 +0000 Subject: [PATCH] [FIX] payment: link tokens to refund transactions Whenever making a refund for a transaction with a saved token the token will appear also on the refund transaction. It is useful to keep track of which token was used in each transaction, this remains true for refunds. The token will also appear on the payments. Task - 2694760 closes odoo/odoo#85484 X-original-commit: 351812a81ec29fe96bf3766c45ea3b51f4055066 Signed-off-by: Antoine Vandevenne (anv) --- addons/payment/models/payment_transaction.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/payment/models/payment_transaction.py b/addons/payment/models/payment_transaction.py index 33aecb65134..8280ba71a4c 100644 --- a/addons/payment/models/payment_transaction.py +++ b/addons/payment/models/payment_transaction.py @@ -599,6 +599,7 @@ class PaymentTransaction(models.Model): 'reference': self._compute_reference(self.provider, prefix=f'R-{self.reference}'), 'amount': -(amount_to_refund or self.amount), 'currency_id': self.currency_id.id, + 'token_id': self.token_id.id, 'operation': 'refund', 'source_transaction_id': self.id, 'partner_id': self.partner_id.id,