fix(patch): Delete all documents from Hub Node module
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index e5644a3..313f378 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -505,4 +505,4 @@
erpnext.patches.v10_0.update_address_template_for_india
erpnext.patches.v10_0.set_discount_amount
erpnext.patches.v10_0.recalculate_gross_margin_for_project
-execute:frappe.delete_doc("Page", "hub", ignore_missing=True)
+erpnext.patches.v10_0.delete_hub_documents
\ No newline at end of file
diff --git a/erpnext/patches/v10_0/delete_hub_documents.py b/erpnext/patches/v10_0/delete_hub_documents.py
new file mode 100644
index 0000000..293969b
--- /dev/null
+++ b/erpnext/patches/v10_0/delete_hub_documents.py
@@ -0,0 +1,17 @@
+
+import frappe
+from frappe.model.utils.rename_field import rename_field
+
+def execute():
+ for dt, dn in (("Page", "Hub"), ("DocType", "Hub Settings"), ("DocType", "Hub Category")):
+ frappe.delete_doc(dt, dn, ignore_missing=True)
+
+ 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)
+ for m in plan_doc.get("mappings"):
+ frappe.delete_doc("Data Migration Mapping", m.mapping, force=True)
+ frappe.delete_doc("Data Migration Plan", plan.name)
+
+ frappe.delete_doc("Module Def", "Hub Node", ignore_missing=True)
+
\ No newline at end of file
diff --git a/erpnext/patches/v10_0/setup_vat_for_uae_and_saudi_arabia.py b/erpnext/patches/v10_0/setup_vat_for_uae_and_saudi_arabia.py
index 587fee1..a8d9049 100644
--- a/erpnext/patches/v10_0/setup_vat_for_uae_and_saudi_arabia.py
+++ b/erpnext/patches/v10_0/setup_vat_for_uae_and_saudi_arabia.py
@@ -7,7 +7,6 @@
def execute():
frappe.reload_doc("accounts", "doctype", "account")
- frappe.reload_doc("hub_node", "doctype", "hub_category")
frappe.reload_doc("accounts", "doctype", "payment_schedule")
for d in frappe.get_all('Company',
filters={'country': ('in', ['Saudi Arabia', 'United Arab Emirates'])}):
diff --git a/erpnext/patches/v8_1/setup_gst_india.py b/erpnext/patches/v8_1/setup_gst_india.py
index a9133ae..5370fa2 100644
--- a/erpnext/patches/v8_1/setup_gst_india.py
+++ b/erpnext/patches/v8_1/setup_gst_india.py
@@ -4,7 +4,6 @@
def execute():
frappe.reload_doc('stock', 'doctype', 'item')
frappe.reload_doc("stock", "doctype", "customs_tariff_number")
- frappe.reload_doc("hub_node", "doctype", "hub_category")
frappe.reload_doc("accounts", "doctype", "payment_terms_template")
frappe.reload_doc("accounts", "doctype", "payment_schedule")