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
This commit is contained in:
Cédric Krier committed 2024-02-29 15:36:16 +01:00
1 parent 555ae0f465
commit 4632152d2b
1 file changed
+1 -1
+1 -1
View File
@@ -484,7 +484,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])