diff --git a/addons/stock/product.py b/addons/stock/product.py index 2016e25a5f6..28f2ff4d04d 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -261,7 +261,7 @@ class product_product(osv.osv): to_date = context.get('to_date',False) date_str = False date_values = False - where = [tuple(location_ids),tuple(location_ids),tuple(ids),tuple(states)] + where = [tuple(location_ids),tuple(ids),tuple(states)] if from_date and to_date: date_str = "date>=%s and date<=%s" where.append(tuple([from_date])) @@ -283,8 +283,7 @@ class product_product(osv.osv): cr.execute( 'select sum(product_qty), product_id, product_uom '\ 'from stock_move '\ - 'where location_id NOT IN %s '\ - 'and location_dest_id IN %s '\ + 'where location_dest_id IN %s '\ 'and product_id IN %s '\ '' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\ 'and state IN %s ' + (date_str and 'and '+date_str+' ' or '') +' '\ @@ -296,7 +295,6 @@ class product_product(osv.osv): 'select sum(product_qty), product_id, product_uom '\ 'from stock_move '\ 'where location_id IN %s '\ - 'and location_dest_id NOT IN %s '\ 'and product_id IN %s '\ '' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\ 'and state in %s ' + (date_str and 'and '+date_str+' ' or '') + ' '\