From 7049e4b110a0f91c86971ca96ad55dacdea93384 Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Thu, 1 Sep 2022 09:57:12 +0000 Subject: [PATCH] [FIX] payment_mercado_pago: remove dead code This commit removes code related to refunds that are not implemented in this version of the Mercado Pago integration. closes odoo/odoo#92848 Related: odoo/documentation#2149 Signed-off-by: Antoine Vandevenne (anv) --- addons/payment_mercado_pago/models/payment_transaction.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/addons/payment_mercado_pago/models/payment_transaction.py b/addons/payment_mercado_pago/models/payment_transaction.py index fb988e2be7b..010648b9920 100644 --- a/addons/payment_mercado_pago/models/payment_transaction.py +++ b/addons/payment_mercado_pago/models/payment_transaction.py @@ -130,8 +130,7 @@ class PaymentTransaction(models.Model): payment_id = notification_data.get('payment_id') if not payment_id: raise ValidationError("Mercado Pago: " + _("Received data with missing payment id.")) - if self.operation != 'refund': - self.acquirer_reference = payment_id + self.acquirer_reference = payment_id # Verify the notification data. verified_payment_data = self.acquirer_id._mercado_pago_make_request( @@ -146,11 +145,6 @@ class PaymentTransaction(models.Model): self._set_pending() elif payment_status in TRANSACTION_STATUS_MAPPING['done']: self._set_done() - - # Immediately post-process the transaction if it is a refund, as the post-processing - # will not be triggered by a customer browsing the transaction from the portal. - if self.operation == 'refund': - self.env.ref('payment.cron_post_process_payment_tx')._trigger() elif payment_status in TRANSACTION_STATUS_MAPPING['canceled']: self._set_canceled() else: # Classify unsupported payment status as the `error` tx state.