diff --git a/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py b/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py index 1735c1224e1..83130966d4c 100644 --- a/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py +++ b/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py @@ -5,7 +5,9 @@ from frappe import _ from frappe.utils.nestedset import rebuild_tree def execute(): - if frappe.db.table_exists("Supplier Type") and not frappe.db.table_exists("Supplier Group"): + if frappe.db.table_exists("Supplier Group"): + frappe.reload_doc('setup', 'doctype', 'supplier_group') + elif frappe.db.table_exists("Supplier Type"): rename_doc("DocType", "Supplier Type", "Supplier Group", force=True) frappe.reload_doc('setup', 'doctype', 'supplier_group') frappe.reload_doc("accounts", "doctype", "pricing_rule")