diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9285143c69e..e65c113c4a8 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -757,6 +757,15 @@ stock_picking() class stock_production_lot(osv.osv): + def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): + if context is None: + context = {} + res = super(stock_production_lot, self).search(cr, uid, args, offset, limit, order, context=context, count=count) + for k,v in self._get_stock(cr, uid, res, 'stock_available', None, context).items(): + if v==0.0: + res.remove(k) + return res + def name_get(self, cr, uid, ids, context={}): if not ids: return []