patch: rename crm note to fcrm note

This commit is contained in:
Shariq Ansari 2024-03-16 17:59:13 +05:30
parent 6988614a4e
commit 8f05d76f9e
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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)