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:
1 parent
1e617e284b
commit
181156bf66
1 file changed
+2
-1
+2
-1
@@ -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':
|
||||
|
||||
Reference in new issue
Block a user