[FIX]sale_stock: do not raise if not able to find any warehouse (for the get default warehouse), it can prevent the user of doing anything (if he does an upgrade of sale_stock module while having no warehouse set, the user will not be able to sign in in his instance again).

bzr revid: dle@openerp.com-20131203095544-i5vmow007dgjbiza
This commit is contained in:
Denis Ledoux 2013-12-03 10:55:44 +01:00
parent da6fee2ac1
commit 64c0ff21d5
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ class sale_order(osv.osv):
company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
warehouse_ids = self.pool.get('stock.warehouse').search(cr, uid, [('company_id', '=', company_id)], context=context)
if not warehouse_ids:
raise osv.except_osv(_('Error!'), _('There is no warehouse defined for current company.'))
return False
return warehouse_ids[0]
# This is False