mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
Merge pull request #46355 from mihir-kandoi/46348
fix: rename_sla_fields patch
This commit is contained in:
@@ -6,8 +6,14 @@ from frappe.model.utils.rename_field import rename_field
|
|||||||
def execute():
|
def execute():
|
||||||
doctypes = frappe.get_all("Service Level Agreement", pluck="document_type")
|
doctypes = frappe.get_all("Service Level Agreement", pluck="document_type")
|
||||||
for doctype in doctypes:
|
for doctype in doctypes:
|
||||||
rename_fieldname(doctype + "-resolution_by", "sla_resolution_by")
|
if doctype == "Issue":
|
||||||
rename_fieldname(doctype + "-resolution_date", "sla_resolution_date")
|
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_by", "sla_resolution_by")
|
||||||
rename_field("Issue", "resolution_date", "sla_resolution_date")
|
rename_field("Issue", "resolution_date", "sla_resolution_date")
|
||||||
|
|||||||
Reference in New Issue
Block a user