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 8ad2e09ef0
commit 5dff376497
1 file changed
+2 -2
+2 -2
View File
@@ -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: