From 98417cafaa570ac7be8abcf53efe4686c02aa602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 19 Mar 2012 14:23:22 +0100 Subject: [PATCH] Use reduce_ids for product_ids clause review290003 --- product.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/product.py b/product.py index 4845e8c515..2588486b72 100644 --- a/product.py +++ b/product.py @@ -6,7 +6,7 @@ from trytond.model import ModelView, ModelSQL, fields from trytond.wizard import Wizard, StateView, StateAction, Button from trytond.pyson import PYSONEncoder from trytond.transaction import Transaction -from trytond.tools import safe_eval +from trytond.tools import safe_eval, reduce_ids from trytond.pool import Pool @@ -397,9 +397,9 @@ class Product(ModelSQL, ModelView): product_template_join = "" product_template_join_period = "" if product_ids: - where_clause += "AND product in (" + \ - ",".join(('%s',) * len(product_ids)) + ")" - where_vals += product_ids + red_clause, red_vals = reduce_ids('product', product_ids) + where_clause += "AND " + red_clause + where_vals += red_vals else: where_clause += "AND product_template.active = %s" where_vals.append(True)