From 5dff376497fb431bf631f3fda96990e9fb033ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 6 Jun 2013 20:41:29 +0200 Subject: [PATCH] Fix date selection when using period in products_by_location effective_date and planned_date could be both NULL so they must be considered as date.max to be included. review897003 (transplanted from 880fcffdafa24b42dc163309b6b24eb3ad5528e4) --- product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product.py b/product.py index ae63abf164..bbe74b1b4f 100644 --- a/product.py +++ b/product.py @@ -365,8 +365,8 @@ class Product(ModelSQL, ModelView): period_id, = period_ids period = period_obj.browse(period_id) state_date_clause += (' AND ' - '(COALESCE(effective_date, planned_date) > %s)') - state_date_vals.append(period.date) + '(COALESCE(effective_date, planned_date, %s) > %s)') + state_date_vals.extend([datetime.date.max, period.date]) period_vals[0] = period.id if with_childs: