diff options
| author | Denis Ledoux <dle@odoo.com> | 2014-09-25 16:24:59 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2014-09-25 16:25:43 +0200 |
| commit | c8f1bebcc5fc80f0dabef235396d4c9ff1dc3c78 (patch) | |
| tree | e5b0121d6b7b6abea5aa8451177ab51528708952 /addons | |
| parent | 942bbad2df54071eb0151b92ab06f6cb4476e7f2 (diff) | |
[FIX] website_sale: free carts were not confirmed
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website_sale/controllers/main.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index dd3a2cfdc94..50a8db02289 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -757,13 +757,13 @@ class website_sale(http.Controller): order = request.registry['sale.order'].browse(cr, SUPERUSER_ID, sale_order_id, context=context) assert order.id == request.session.get('sale_last_order_id') - if not tx or not order: + if not order or (order.amount_total and not tx): return request.redirect('/shop') - if not order.amount_total or tx.state in ['pending', 'done']: + if (not order.amount_total and not tx) or tx.state in ['pending', 'done']: # send by email email_act = sale_order_obj.action_quotation_send(cr, SUPERUSER_ID, [order.id], context=request.context) - elif tx.state == 'cancel': + elif tx and tx.state == 'cancel': # cancel the quotation sale_order_obj.action_cancel(cr, SUPERUSER_ID, [order.id], context=request.context) |
