From 39b0e3522a71b5b4460cd25666f11a1ab641fb8e Mon Sep 17 00:00:00 2001 From: ljain112 Date: Wed, 25 Feb 2026 19:27:52 +0530 Subject: [PATCH] fix: ensure cache is cleared on fiscal year update and trash --- erpnext/accounts/doctype/fiscal_year/fiscal_year.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py index 38f3a91c8fe..52fe3cd148c 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -33,6 +33,12 @@ class FiscalYear(Document): self.validate_dates() self.validate_overlap() + def on_update(self): + frappe.cache().delete_key("fiscal_years") + + def on_trash(self): + frappe.cache().delete_key("fiscal_years") + def validate_dates(self): self.validate_from_to_dates("year_start_date", "year_end_date") if self.is_short_year: