From 64c0ff21d5b6810d42b2fcabf6553147ff0aa55f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 3 Dec 2013 10:55:44 +0100 Subject: [PATCH] [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 --- addons/sale_stock/sale_stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index 341aaef8ca8..26d9d80f13e 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -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