From 76239f0654e87f6330b80229834ba3bd98649e62 Mon Sep 17 00:00:00 2001 From: "Theo VINCENT (thvi)" Date: Mon, 24 Jul 2023 12:28:40 +0000 Subject: [PATCH] [FIX] pos_online_payment: remove override As explained by ANV (https://github.com/odoo/odoo/pull/123237#pullrequestreview-1537263584), the override of _set_authorized method of payment.transaction model is currently dangerous and should be removed. Indeed, he explains that any error in the _set_authorized method will remove the transaction from the database, even if it is successful. According to him, the current safe approach is to only override _reconcile_after_done to catch successful transactions and process them safely. closes odoo/odoo#131408 X-original-commit: b12f6df9e497fd0546c91f88f94f92dc5b606373 Signed-off-by: Joseph Caburnay (jcb) --- addons/pos_online_payment/models/payment_transaction.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/addons/pos_online_payment/models/payment_transaction.py b/addons/pos_online_payment/models/payment_transaction.py index 7be95a6eed7..54aabf61b35 100644 --- a/addons/pos_online_payment/models/payment_transaction.py +++ b/addons/pos_online_payment/models/payment_transaction.py @@ -24,11 +24,6 @@ class PaymentTransaction(models.Model): return pos_order.pos_reference return super()._compute_reference_prefix(provider_code, separator, **values) - def _set_authorized(self, state_message=None, **kwargs): - """ Override of payment to process POS online payments automatically. """ - super()._set_authorized(state_message=state_message, **kwargs) - self._process_pos_online_payment() - def _reconcile_after_done(self): """ Override of payment to process POS online payments automatically. """ super()._reconcile_after_done()