[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) <vfe@odoo.com> Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user