From f02cf4a195c0aa08df7701c9aa5aba0a3005e7af Mon Sep 17 00:00:00 2001 From: Horacio Tellez Date: Tue, 9 Nov 2021 13:13:23 +0000 Subject: [PATCH] [FIX] payment: hide the refund button on payments created from a refund task-2685480 closes odoo/odoo#90085 X-original-commit: 02eba891cb8cd58985837090f2b60cf263bce065 Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Horacio Tellez Perez (hote) --- addons/payment/models/account_payment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/payment/models/account_payment.py b/addons/payment/models/account_payment.py index c7fb29fbd45..cb416b81c14 100644 --- a/addons/payment/models/account_payment.py +++ b/addons/payment/models/account_payment.py @@ -44,7 +44,8 @@ class AccountPayment(models.Model): def _compute_amount_available_for_refund(self): for payment in self: - if payment.payment_transaction_id.sudo().acquirer_id.support_refund: + tx = payment.payment_transaction_id + if tx.acquirer_id.sudo().support_refund and tx.operation != 'refund': # Only consider refund transactions that are confirmed by summing the amounts of # payments linked to such refund transactions. Indeed, should a refund transaction # be stuck forever in a transient state (due to webhook failure, for example), the