Check context value in get_quantity on stock.location

Verify that the product id from context has a real product record
This commit is contained in:
Cédric Krier committed 2009-02-04 13:57:11 +01:00
1 parent 46ffb68bf6
commit f95485591c
1 file changed
+8 -1
+8 -1
View File
@@ -131,7 +131,14 @@ class Location(OSV):
if (not context.get('product')) \
or not (isinstance(context['product'], (int, long))):
return dict([(i,0) for i in ids])
return dict([(i, 0) for i in ids])
ctx = context.copy()
ctx['active_test'] = False
if not product_obj.search(cursor, user, [
('id', '=', context['product']),
], context=ctx):
return dict([(i, 0) for i in ids])
if name == 'quantity' and \
context.get('stock_date_end') > \