diff --git a/modules/stock_lot_sled/stock.py b/modules/stock_lot_sled/stock.py index 33b72d487b..93894e7539 100644 --- a/modules/stock_lot_sled/stock.py +++ b/modules/stock_lot_sled/stock.py @@ -379,7 +379,9 @@ class Period(metaclass=PoolMeta): # Don't allow to close a period if all products at this date # are not yet expired - recent_date = max(period.date for period in periods) + recent_date = max( + (period.date for period in periods), + default=datetime.date.min) today = Date.today() query = move.join(lot, 'INNER',