From 50cdacba903bf57cad31d2edfba9c8cb6bc6783d Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 16 Mar 2015 20:54:59 +0100 Subject: [PATCH] [FIX] stock: search qty available correction when searching zero quantities When =, >=, <= 0 it cannot use the read_group of quants because the results will not be in the read_group Fixes #5701 --- addons/stock/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index dd2d5272cfe..5e0dca5adf8 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -185,7 +185,7 @@ class product_product(osv.osv): operator = '==' ids = [] - if name == 'qty_available': + if name == 'qty_available' and (value != 0.0 or operator not in ('==', '>=', '<=')): res.append(('id', 'in', self._search_qty_available(cr, uid, operator, value, context))) else: product_ids = self.search(cr, uid, [], context=context)