From cde2f4668a06a371fb52236e2fa8289fcd76e875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 18 Apr 2010 19:25:47 +0200 Subject: [PATCH] Fix _search_quantity_eval_domain as domain is no more a list for issue1525 --- product.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/product.py b/product.py index 25b698db5e..ad2e6c2586 100644 --- a/product.py +++ b/product.py @@ -97,17 +97,15 @@ class Product(ModelSQL, ModelView): return res def _search_quantity_eval_domain(self, line, domain): - res = True - for field, operator, operand in domain: - value = line.get(field) - if value == None: - return False - if operator not in ("=", ">=", "<=", ">", "<", "!="): - return False - if operator == "=": - operator= "==" - res = res and (eval(str(value) + operator + str(operand))) - return res + field, operator, operand = domain + value = line.get(field) + if value == None: + return False + if operator not in ("=", ">=", "<=", ">", "<", "!="): + return False + if operator == "=": + operator= "==" + return (eval(str(value) + operator + str(operand))) def search_quantity(self, cursor, user, name, domain=None, context=None): date_obj = self.pool.get('ir.date')