refactor: trigger cache clearing with clear_cache hook
This commit is contained in:
parent
2efc3c9cb4
commit
fd4245fc56
1 changed files with 2 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue