[FIX] Correct Stock Level Forecast report

bzr revid: jco@openerp.com-20140317152213-iiknesh2j3qppjdi
This commit is contained in:
Josse Colpaert 2014-03-17 16:22:13 +01:00
parent b01a61e396
commit 48901e5b3a
1 changed files with 6 additions and 4 deletions

View File

@ -66,11 +66,13 @@ class report_stock(report_int):
for name in names:
names[name] = names[name].encode('utf8')
products = {}
prods = registry['stock.location']._product_all_get(cr, uid, location_id, product_ids)
ctx = context.copy()
ctx['location_id'] = loc_ids
prods = registry['product.product']._product_available(cr, uid, product_ids, context=ctx)
for prod in prods.keys():
products[prod] = [(now, prods[prod]['qty_available'])]
prods[prod] = 0
for p in prods:
products[p] = [(now,prods[p])]
prods[p] = 0
if not loc_ids or not product_ids:
return (False, 'pdf')