[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) <anv@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
This commit is contained in:
Horacio Tellez
2022-04-29 12:06:15 +02:00
committed by Antoine Vandevenne (anv)
parent b64348fa31
commit f02cf4a195
+2 -1
View File
@@ -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