From ae6ab96629b02c2738dceb56e3bfd844fc3754f0 Mon Sep 17 00:00:00 2001 From: Toufik Ben Jaa Date: Fri, 16 Nov 2018 09:40:12 +0000 Subject: [PATCH] [FIX] payment: if a payment transaction processing fail, rollback. - Before this commit when a transaction failed, the code doesn't rollback and continue to process the other transaction, thus creating record that should be rollbacked. closes odoo/odoo#28748 --- addons/payment/models/payment_acquirer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index b2ab12b1a94..8864a09d4f1 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -799,7 +799,8 @@ class PaymentTransaction(models.Model): tx._post_process_after_done() self.env.cr.commit() except Exception as e: - _logger.error("Transaction post processing failed, reason \"%s\"", e) + _logger.exception("Transaction post processing failed") + self.env.cr.rollback() @api.model def _compute_reference_prefix(self, values):