mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +00:00
check if Data Migration Plan exists before deleting (#15368)
This commit is contained in:
@@ -6,6 +6,7 @@ def execute():
|
||||
for dt, dn in (("Page", "Hub"), ("DocType", "Hub Settings"), ("DocType", "Hub Category")):
|
||||
frappe.delete_doc(dt, dn, ignore_missing=True)
|
||||
|
||||
if frappe.db.exists("DocType", "Data Migration Plan"):
|
||||
data_migration_plans = frappe.get_all("Data Migration Plan", filters={"module": 'Hub Node'})
|
||||
for plan in data_migration_plans:
|
||||
plan_doc = frappe.get_doc("Data Migration Plan", plan.name)
|
||||
@@ -14,4 +15,3 @@ def execute():
|
||||
frappe.delete_doc("Data Migration Plan", plan.name)
|
||||
|
||||
frappe.delete_doc("Module Def", "Hub Node", ignore_missing=True)
|
||||
|
||||
Reference in New Issue
Block a user