From b0ab39804cf27bf6a6881a5d28db3cee2cc398e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 16 Apr 2013 15:31:10 +0200 Subject: [PATCH] Include NULL planned_date with datetime.date.max review790002 --- product.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/product.py b/product.py index 5bc33c13a0..0344367c49 100644 --- a/product.py +++ b/product.py @@ -284,9 +284,9 @@ class Product: '(' '(effective_date IS NULL) ' 'AND ' - '(planned_date <= %s) ' + '(COALESCE(planned_date, %s) <= %s) ' 'AND ' - '(planned_date >= %s)' + '(COALESCE(planned_date, %s) >= %s)' ')' 'OR ' '(' @@ -302,7 +302,8 @@ class Product: 'done', context.get('stock_assign') and 'assigned' or 'done', today, today, 'done', 'assigned', 'draft', - context['stock_date_end'], today, + datetime.date.max, context['stock_date_end'], + datetime.date.max, today, context['stock_date_end'], today, ]