Merge pull request #46357 from frappe/mergify/bp/version-15-hotfix/pr-46355

fix: rename_sla_fields patch (backport #46355)
This commit is contained in:
rohitwaghchaure
2025-03-06 13:48:54 +05:30
committed by GitHub

View File

@@ -6,8 +6,14 @@ from frappe.model.utils.rename_field import rename_field
def execute():
doctypes = frappe.get_all("Service Level Agreement", pluck="document_type")
for doctype in doctypes:
rename_fieldname(doctype + "-resolution_by", "sla_resolution_by")
rename_fieldname(doctype + "-resolution_date", "sla_resolution_date")
if doctype == "Issue":
continue
if frappe.db.exists("Custom Field", {"fieldname": doctype + "-resolution_by"}):
rename_fieldname(doctype + "-resolution_by", "sla_resolution_by")
if frappe.db.exists("Custom Field", {"fieldname": doctype + "-resolution_date"}):
rename_fieldname(doctype + "-resolution_date", "sla_resolution_date")
rename_field("Issue", "resolution_by", "sla_resolution_by")
rename_field("Issue", "resolution_date", "sla_resolution_date")