fix: Minor issues in existing patches
diff --git a/erpnext/patches/v13_0/remove_bad_selling_defaults.py b/erpnext/patches/v13_0/remove_bad_selling_defaults.py
index 5487a6c..0262539 100644
--- a/erpnext/patches/v13_0/remove_bad_selling_defaults.py
+++ b/erpnext/patches/v13_0/remove_bad_selling_defaults.py
@@ -3,6 +3,7 @@
 
 
 def execute():
+	frappe.reload_doctype('Selling Settings')
 	selling_settings = frappe.get_single("Selling Settings")
 
 	if selling_settings.customer_group in (_("All Customer Groups"), "All Customer Groups"):
diff --git a/erpnext/patches/v13_0/update_maintenance_schedule_field_in_visit.py b/erpnext/patches/v13_0/update_maintenance_schedule_field_in_visit.py
index 450c00e..7a8c1c6 100644
--- a/erpnext/patches/v13_0/update_maintenance_schedule_field_in_visit.py
+++ b/erpnext/patches/v13_0/update_maintenance_schedule_field_in_visit.py
@@ -3,6 +3,9 @@
 
 
 def execute():
+	frappe.reload_doctype('Maintenance Visit')
+	frappe.reload_doctype('Maintenance Visit Purpose')
+
 	# Updates the Maintenance Schedule link to fetch serial nos
 	from frappe.query_builder.functions import Coalesce
 	mvp = frappe.qb.DocType('Maintenance Visit Purpose')
diff --git a/erpnext/patches/v14_0/migrate_crm_settings.py b/erpnext/patches/v14_0/migrate_crm_settings.py
index 30d3ea0..0c77853 100644
--- a/erpnext/patches/v14_0/migrate_crm_settings.py
+++ b/erpnext/patches/v14_0/migrate_crm_settings.py
@@ -9,8 +9,9 @@
 	], as_dict=True)
 
 	frappe.reload_doc('crm', 'doctype', 'crm_settings')
-	frappe.db.set_value('CRM Settings', 'CRM Settings', {
-		'campaign_naming_by': settings.campaign_naming_by,
-		'close_opportunity_after_days': settings.close_opportunity_after_days,
-		'default_valid_till': settings.default_valid_till
-	})
+	if settings:
+		frappe.db.set_value('CRM Settings', 'CRM Settings', {
+			'campaign_naming_by': settings.campaign_naming_by,
+			'close_opportunity_after_days': settings.close_opportunity_after_days,
+			'default_valid_till': settings.default_valid_till
+		})