fix: Clear Document cache on rename, delete

This commit is contained in:
Gavin D'souza 2022-01-03 19:02:41 +05:30
parent e3fc400fd4
commit f72c445d41
2 changed files with 3 additions and 1 deletions

View file

@ -117,7 +117,8 @@ def delete_doc(doctype=None, name=None, force=0, ignore_doctypes=None, for_reloa
doctype=doc.doctype, name=doc.name,
is_async=False if frappe.flags.in_test else True)
# clear cache for Document
doc.clear_cache()
# delete global search entry
delete_for_document(doc)
# delete tag link entry

View file

@ -110,6 +110,7 @@ def rename_doc(
if merge:
frappe.delete_doc(doctype, old)
new_doc.clear_cache()
frappe.clear_cache()
if rebuild_search:
frappe.enqueue('frappe.utils.global_search.rebuild_for_doctype', doctype=doctype)