Skip to content

Commit 2495cb8

Browse files
ljain112mergify[bot]
authored andcommitted
fix: ensure cache is cleared on fiscal year update and trash
(cherry picked from commit 39b0e35)
1 parent a864ca5 commit 2495cb8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

erpnext/accounts/doctype/fiscal_year/fiscal_year.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ def validate(self):
3333
self.validate_dates()
3434
self.validate_overlap()
3535

36+
def on_update(self):
37+
frappe.cache().delete_key("fiscal_years")
38+
39+
def on_trash(self):
40+
frappe.cache().delete_key("fiscal_years")
41+
3642
def validate_dates(self):
3743
self.validate_from_to_dates("year_start_date", "year_end_date")
3844
if self.is_short_year:

0 commit comments

Comments
 (0)