From a7137514b69caac2a1371d080e902ea982269aa0 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 25 Aug 2023 21:05:49 +0530 Subject: [PATCH] chore: Update patch --- erpnext/patches/v14_0/delete_education_doctypes.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/erpnext/patches/v14_0/delete_education_doctypes.py b/erpnext/patches/v14_0/delete_education_doctypes.py index 468c2fda32..56a596a02e 100644 --- a/erpnext/patches/v14_0/delete_education_doctypes.py +++ b/erpnext/patches/v14_0/delete_education_doctypes.py @@ -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)