Initialize recent date when closing periods with empty period list
(grafted from beed0d8fffcf8aa86ac5e6a2fe50adbfb7e5adcc) --HG-- branch : 6.0
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user