[FIX] website_sale: reset sale order from session if status is no more in draft
When a sale order has in state != draft, we raise a error message since commit
f6c65a3d9e
.
But if we don't reset the sale order id from the session, the user cannot
continue to navigate on website because the user will have the error each time.
This commit is contained in:
parent
4a5e2fe99e
commit
31301bb31a
|
@ -75,6 +75,7 @@ class sale_order(osv.Model):
|
|||
quantity = 0
|
||||
for so in self.browse(cr, uid, ids, context=context):
|
||||
if so.state != 'draft':
|
||||
request.session['sale_order_id'] = None
|
||||
raise osv.except_osv(_('Error!'), _('It is forbidden to modify a sale order which is not in draft status'))
|
||||
if line_id != False:
|
||||
line_ids = so._cart_find_product_line(product_id, line_id, context=context, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue