[IMP]Task Id:1852 Product form - the link stock by location ->get focusing product stock

bzr revid: ron@tinyerp.com-20101124113247-1sa7zy74ztg8e98a
This commit is contained in:
ron@tinyerp.com
2010-11-24 17:02:47 +05:30
parent 3f6d202006
commit 4936fb1bf2
+3
View File
@@ -110,6 +110,7 @@ class stock_location(osv.osv):
@param field_names: Name of field
@return: Dictionary of values
"""
prod_id = context and context.get('product_id', False)
product_product_obj = self.pool.get('product.product')
@@ -125,6 +126,8 @@ class stock_location(osv.osv):
currency = self.pool.get('res.currency').browse(cr, uid, currency_id)
currency_obj.round(cr, uid, currency, 300)
for loc_id, product_ids in products_by_location.items():
if prod_id:
product_ids = [prod_id]
c = (context or {}).copy()
c['location'] = loc_id
for prod in product_product_obj.browse(cr, uid, product_ids, context=c):