Merge pull request #15393 from codingCoffee/hub

fix(patch): delete hub documents
This commit is contained in:
Ameya Shenoy 2018-09-12 17:50:02 +05:30 committed by GitHub
commit ecac822613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,4 +12,7 @@ def execute():
plan_doc = frappe.get_doc("Data Migration Plan", plan.name)
for m in plan_doc.get("mappings"):
frappe.delete_doc("Data Migration Mapping", m.mapping, force=True)
docs = frappe.get_all("Data Migration Run", filters={"data_migration_plan": plan.name})
for doc in docs:
frappe.delete_doc("Data Migration Run", doc.name)
frappe.delete_doc("Data Migration Plan", plan.name)