fix: delete doc without filters
diff --git a/erpnext/patches/v14_0/delete_education_doctypes.py b/erpnext/patches/v14_0/delete_education_doctypes.py
index 24b9fa1..468c2fd 100644
--- a/erpnext/patches/v14_0/delete_education_doctypes.py
+++ b/erpnext/patches/v14_0/delete_education_doctypes.py
@@ -44,11 +44,14 @@
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(