Skip to content

Commit

Permalink
fix: hardcode education module doctypes in patch
Browse files Browse the repository at this point in the history
  • Loading branch information
GursheenK committed Sep 15, 2023
1 parent 8ca1ff3 commit e40d943
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions erpnext/patches/v14_0/delete_education_doctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ def execute():
for doctype in doctypes:
frappe.delete_doc("DocType", doctype, ignore_missing=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()
titles = [
"Fees",
"Student Admission",
"Grant Application",
"Chapter",
"Certification Application",
]
items = frappe.get_all("Portal Menu Item", filters=[["title", "in", titles]], pluck="name")
for item in items:
frappe.delete_doc("Portal Menu Item", item, ignore_missing=True, force=True)

frappe.delete_doc("Module Def", "Education", ignore_missing=True, force=True)

Expand Down
2 changes: 1 addition & 1 deletion erpnext/patches/v14_0/delete_healthcare_doctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def execute():
for card in cards:
frappe.delete_doc("Number Card", card, ignore_missing=True, force=True)

titles = ["Lab Test", "Prescription", "Patient Appointment"]
titles = ["Lab Test", "Prescription", "Patient Appointment", "Patient"]
items = frappe.get_all("Portal Menu Item", filters=[["title", "in", titles]], pluck="name")
for item in items:
frappe.delete_doc("Portal Menu Item", item, ignore_missing=True, force=True)
Expand Down

0 comments on commit e40d943

Please sign in to comment.