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)
This commit is contained in:
Cédric Krier committed 2013-06-06 20:41:29 +02:00
1 parent 3e2a631e90
commit e89896b161
1 file changed
+2 -2
+2 -2
View File
@@ -393,8 +393,8 @@ class Product:
if periods:
period, = periods
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: