diff --git a/erpnext/patches/v13_0/remove_bad_selling_defaults.py b/erpnext/patches/v13_0/remove_bad_selling_defaults.py index 5487a6c60cc..02625396dd1 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 @@ from frappe import _ 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 450c00e4212..7a8c1c61356 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 @@ import frappe 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 30d3ea0cb1f..0c7785367c3 100644 --- a/erpnext/patches/v14_0/migrate_crm_settings.py +++ b/erpnext/patches/v14_0/migrate_crm_settings.py @@ -9,8 +9,9 @@ def execute(): ], 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 + })