refactor: trigger cache clearing with clear_cache hook

This commit is contained in:
Ankush Menat 2026-03-25 16:45:22 +05:30
parent 2efc3c9cb4
commit fd4245fc56

View file

@ -85,9 +85,6 @@ class Report(Document):
def before_insert(self):
self.set_doctype_roles()
def after_insert(self):
self.update_report_cache()
def on_update(self):
self.export_doc()
@ -109,8 +106,9 @@ class Report(Document):
delete_custom_role("report", self.name)
def after_delete(self):
def clear_cache(self):
self.update_report_cache()
return super().clear_cache()
def update_report_cache(self):
from frappe.boot import get_allowed_reports