diff --git a/erpnext/patches/v15_0/migrate_to_utm_analytics.py b/erpnext/patches/v15_0/migrate_to_utm_analytics.py index c8a1d6fc5b4..4385e1ab453 100644 --- a/erpnext/patches/v15_0/migrate_to_utm_analytics.py +++ b/erpnext/patches/v15_0/migrate_to_utm_analytics.py @@ -10,6 +10,8 @@ def execute(): Remove Lead Source doctype and use UTM Source Instead Ensure that for each Campaign, a UTM Campaign is also set """ + if not frappe.db.exists("DocType", "Lead Source") or not frappe.db.exists("DocType", "UTM Source"): + return ls = frappe.qb.DocType("Lead Source") ms = frappe.qb.DocType("UTM Source")