[FIX] stock: add location in context on prodlot search
To be consistant with the results of _get_stock. Otherwise search made on stock_available may not display results with the same value than the search criteria. Fixes #3976
This commit is contained in:
parent
6e346f0adb
commit
34b9f43011
|
@ -1437,7 +1437,15 @@ class stock_production_lot(osv.osv):
|
|||
""" Searches Ids of products
|
||||
@return: Ids of locations
|
||||
"""
|
||||
locations = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'internal')])
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
if 'location_id' not in context:
|
||||
locations = self.pool['stock.location'].search(
|
||||
cr, uid, [('usage', '=', 'internal')], context=context)
|
||||
else:
|
||||
locations = context['location_id'] and [context['location_id']] or []
|
||||
|
||||
cr.execute('''select
|
||||
prodlot_id,
|
||||
sum(qty)
|
||||
|
|
Loading…
Reference in New Issue