From 154b12479217e8ef5efb1ebe4cc44d3c506bc847 Mon Sep 17 00:00:00 2001 From: husen daudi Date: Tue, 10 Mar 2009 18:51:10 +0530 Subject: [PATCH] bugfix lp bug: https://launchpad.net/bugs/338329 fixed bzr revid: hda@hda-20090310132110-mywe7eh3su2kks4g --- addons/stock/stock.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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 []