From 3b29353565a2bfff2fe8af453f3c05b6140ae366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 29 Feb 2024 15:36:16 +0100 Subject: [PATCH] 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 --- modules/account/tests/test_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/account/tests/test_module.py b/modules/account/tests/test_module.py index 1570cc4b42..32238a7d0a 100644 --- a/modules/account/tests/test_module.py +++ b/modules/account/tests/test_module.py @@ -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])