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:
1 parent
46ffb68bf6
commit
f95485591c
1 file changed
+8
-1
+8
-1
@@ -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') > \
|
||||
|
||||
Reference in new issue
Block a user