From 0a21137baa8cba284493390bb69e64f9cb6f62cb Mon Sep 17 00:00:00 2001 From: Achraf Date: Mon, 23 Oct 2023 15:33:17 +0200 Subject: [PATCH] [FIX] sale: prevent transaction confirmation with `group_auto_done_setting` Steps: - Install `website_sale` - Enable `Lock Confirmed Sale` - Enable `On Site Payments & Picking` - Enable `Pay in-store` payment provider - Login with demo user and go to shop - Add a random product and go to checkout - Confirm and choose on-site payment/picking - In the backend with admin user confirm the newly created sale order - Go to Payment Transaction The transaction is marked as confirmed without payment. Without `Lock Confirmed Sale` it works. The solution is to mark transaction as confirmed only if it is `wire_transfer` opw-3501140 closes odoo/odoo#139533 X-original-commit: 71db47cff99ce3b2090c3be5dfa3205654625d51 Signed-off-by: Victor Feyens (vfe) Signed-off-by: Achraf Ben Azzouz (abz) --- addons/sale/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale_order.py b/addons/sale/models/sale_order.py index e2e4eaa6f1c..f9fd4385ffa 100644 --- a/addons/sale/models/sale_order.py +++ b/addons/sale/models/sale_order.py @@ -1003,7 +1003,7 @@ class SaleOrder(models.Model): def action_lock(self): for order in self: tx = order.sudo().transaction_ids._get_last() - if tx and tx.state == 'pending' and tx.provider_id.code == 'custom': + if tx and tx.state == 'pending' and tx.provider_id.code == 'custom' and tx.provider_id.custom_mode == 'wire_transfer': tx._set_done() tx.write({'is_post_processed': True}) self.locked = True