Prevent to compare datetime.date to NoneType

This may happen if stock_date_end is not set in the context.
This commit is contained in:
Cédric Krier committed 2018-03-09 19:41:13 +01:00
1 parent 1e617e284b
commit 181156bf66
1 file changed
+2 -1
+2 -1
View File
@@ -318,7 +318,8 @@ class Location(ModelSQL, ModelView):
context = {}
if (name == 'quantity'
and trans_context.get('stock_date_end') > Date_.today()):
and (trans_context.get('stock_date_end', datetime.date.max)
> Date_.today())):
context['stock_date_end'] = Date_.today()
if name == 'forecast_quantity':