Do not fail on leap day to create next fiscal year
Replace the year of a date is not safe, it is better to use relativedelta. Closes #13064 (grafted from 4b19fb0bc801a784139c0c6245d8649480e13280) --HG-- branch : 7.0
This commit is contained in:
1 parent
1eb61dcb1a
commit
3b29353565
1 file changed
+1
-1
@@ -424,7 +424,7 @@ class AccountTestCase(
|
||||
# Use next fiscalyear
|
||||
today = datetime.date.today()
|
||||
next_fiscalyear = get_fiscalyear(company,
|
||||
today=today.replace(year=today.year + 1))
|
||||
today=today + relativedelta(years=1))
|
||||
next_fiscalyear.save()
|
||||
FiscalYear.create_period([next_fiscalyear])
|
||||
|
||||
|
||||
Reference in new issue
Block a user