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 : 6.0
This commit is contained in:
1 parent
22a7ecdfa2
commit
d620f7bf14
1 file changed
+1
-1
@@ -381,7 +381,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