fix: delete doc without filters

This commit is contained in:
Gursheen Anand 2023-08-16 17:35:07 +05:30
parent c071523e35
commit d119d2ec32

View File

@ -44,11 +44,14 @@ def execute():
doctypes = frappe.get_all("DocType", {"module": "education", "custom": 0}, pluck="name")
for doctype in doctypes:
frappe.delete_doc(
"Portal Menu Item", {"reference_doctype": doctype}, ignore_missing=True, force=True
)
frappe.delete_doc("DocType", doctype, ignore_missing=True)
portal_menu_items = frappe.get_all(
"Portal Menu Item", {"reference_doctype": ("in", doctypes)}, pluck="name"
)
for menu_item in portal_menu_items:
frappe.delete_doc("Portal Menu Item", menu_item, ignore_missing=True, force=True)
frappe.delete_doc("Module Def", "Education", ignore_missing=True, force=True)
click.secho(