diff --git a/crm/patches.txt b/crm/patches.txt index f4ea0695..cbc0eaef 100644 --- a/crm/patches.txt +++ b/crm/patches.txt @@ -1,6 +1,7 @@ [pre_model_sync] # Patches added in this section will be executed before doctypes are migrated # Read docs to understand patches: https://frappeframework.com/docs/v14/user/en/database-migrations +crm.patches.v1_0.rename_crm_note_to_fcrm_note [post_model_sync] # Patches added in this section will be executed after doctypes are migrated diff --git a/crm/patches/v1_0/rename_crm_note_to_fcrm_note.py b/crm/patches/v1_0/rename_crm_note_to_fcrm_note.py new file mode 100644 index 00000000..38cc09c3 --- /dev/null +++ b/crm/patches/v1_0/rename_crm_note_to_fcrm_note.py @@ -0,0 +1,13 @@ +import frappe +from frappe.model.rename_doc import rename_doc + + +def execute(): + if frappe.db.exists("DocType", "FCRM Note"): + return + + frappe.flags.ignore_route_conflict_validation = True + rename_doc("DocType", "CRM Note", "FCRM Note") + frappe.flags.ignore_route_conflict_validation = False + + frappe.reload_doctype("FCRM Note", force=True) \ No newline at end of file