chore: Update patch

This commit is contained in:
Deepesh Garg 2023-08-25 21:05:49 +05:30
parent 6a7b45f689
commit a7137514b6

View File

@ -43,14 +43,17 @@ def execute():
frappe.delete_doc("Number Card", card, ignore_missing=True, force=True)
doctypes = frappe.get_all("DocType", {"module": "education", "custom": 0}, pluck="name")
for doctype in doctypes:
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)
portal_settings = frappe.get_doc("Portal Settings")
for row in portal_settings.get("menu"):
if row.reference_doctype in doctypes:
row.delete()
portal_settings.save()
frappe.delete_doc("Module Def", "Education", ignore_missing=True, force=True)