From cb5f16bd17e3245ccd2c70e26a9bcf071b871f7e Mon Sep 17 00:00:00 2001 From: Harshad Modi Date: Fri, 10 Oct 2008 20:26:59 +0530 Subject: [PATCH] fixed bug bzr revid: hmo@tinyerp.com-20081010145659-f52i8be3dhfptk83 --- addons/stock/product.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index e9ed8b32944..f9eeef4f907 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -69,10 +69,11 @@ class product_product(osv.osv): location_ids = context['location'] else: cr.execute("select lot_stock_id from stock_warehouse") - location_ids = [id for (id,) in cr.fetchall()] + location_ids = [id for (id,) in cr.fetchall()] # build the list of ids of children of the location given by id - location_ids = self.pool.get('stock.location').search(cr, uid, [('location_id', 'child_of', location_ids)]) + child_location_ids = self.pool.get('stock.location').search(cr, uid, [('location_id', 'child_of', location_ids)]) + location_ids= len(child_location_ids) and child_location_ids or location_ids states_str = ','.join(map(lambda s: "'%s'" % s, states))