diff --git a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py index 1e179b15313..0f0a6837cba 100644 --- a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py @@ -38,8 +38,21 @@ def test_record_generator(): ] start = 2012 + this_year = now_datetime().year end = now_datetime().year + 25 - for year in range(start, end): + # The current year fails to load with the following error: + # Year start date or end date is overlapping with 2024. To avoid please set company + # This is a quick-fix: if current FY is needed, please refactor test data properly + for year in range(start, this_year): + test_records.append( + { + "doctype": "Fiscal Year", + "year": f"_Test Fiscal Year {year}", + "year_start_date": f"{year}-01-01", + "year_end_date": f"{year}-12-31", + } + ) + for year in range(this_year + 1, end): test_records.append( { "doctype": "Fiscal Year",