diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index a7c9b68d342..1e9d9d52f37 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -731,13 +731,16 @@ class website_sale(http.Controller): # find an already existing transaction tx = request.website.sale_get_transaction() if tx: - if tx.state == 'draft': # button cliked but no more info -> rewrite on tx or create a new one ? + tx_id = tx.id + if tx.reference != order.name: + tx = False + tx_id = False + elif tx.state == 'draft': # button cliked but no more info -> rewrite on tx or create a new one ? tx.write({ 'acquirer_id': acquirer_id, 'amount': order.amount_total, }) - tx_id = tx.id - else: + if not tx: tx_id = transaction_obj.create(cr, SUPERUSER_ID, { 'acquirer_id': acquirer_id, 'type': 'form',