From 736a3e58113745065bf1c8ea61bd8c2dfc06d4e3 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 19 Jun 2012 09:40:07 +0200 Subject: [PATCH] [FIX] stock: correct order of query parameters, broken in commit 6848 bzr revid: odo@openerp.com-20120619074007-bp2snzj1uoybayxp --- addons/stock/product.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index 09a73852e82..af4beb88ade 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -248,6 +248,8 @@ class product_product(osv.osv): elif to_date: date_str = "date<=%s" date_values = [to_date] + if date_values: + where.append(tuple(date_values)) prodlot_id = context.get('prodlot_id', False) prodlot_clause = '' @@ -255,9 +257,7 @@ class product_product(osv.osv): prodlot_clause = ' and prodlot_id = %s ' where += [prodlot_id] - # TODO: perhaps merge in one query. - if date_values: - where.append(tuple(date_values)) + # TODO: perhaps merge in one query. if 'in' in what: # all moves from a location out of the set to a location in the set cr.execute(