mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-26 06:31:13 +01:00
fix: rename sla fields patch (#46465)
* fix: rename sla fields patch
* fix: rerun patch
(cherry picked from commit 8bce42e633)
# Conflicts:
# erpnext/patches.txt
This commit is contained in:
@@ -400,4 +400,10 @@ erpnext.patches.v15_0.rename_sla_fields
|
|||||||
erpnext.patches.v15_0.update_query_report
|
erpnext.patches.v15_0.update_query_report
|
||||||
erpnext.patches.v15_0.rename_field_from_rate_difference_to_amount_difference
|
erpnext.patches.v15_0.rename_field_from_rate_difference_to_amount_difference
|
||||||
erpnext.patches.v15_0.recalculate_amount_difference_field
|
erpnext.patches.v15_0.recalculate_amount_difference_field
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
erpnext.patches.v15_0.rename_sla_fields #2025-03-12
|
||||||
|
erpnext.stock.doctype.stock_ledger_entry.patches.ensure_sle_indexes
|
||||||
|
erpnext.patches.v15_0.update_query_report
|
||||||
|
>>>>>>> 8bce42e633 (fix: rename sla fields patch (#46465))
|
||||||
erpnext.patches.v15_0.set_purchase_receipt_row_item_to_capitalization_stock_item
|
erpnext.patches.v15_0.set_purchase_receipt_row_item_to_capitalization_stock_item
|
||||||
|
|||||||
@@ -4,15 +4,19 @@ from frappe.model.utils.rename_field import rename_field
|
|||||||
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
doctypes = list(set(frappe.get_all("Service Level Agreement", pluck="document_type")))
|
doctypes = frappe.get_all("Service Level Agreement", pluck="document_type", distinct=True)
|
||||||
for doctype in doctypes:
|
for doctype in doctypes:
|
||||||
if doctype == "Issue":
|
if doctype == "Issue":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if frappe.db.exists("Custom Field", {"name": doctype + "-resolution_by"}):
|
if frappe.db.exists(
|
||||||
|
"Custom Field", {"name": doctype + "-resolution_by", "fieldname": "resolution_by"}
|
||||||
|
):
|
||||||
rename_fieldname(doctype + "-resolution_by", "sla_resolution_by")
|
rename_fieldname(doctype + "-resolution_by", "sla_resolution_by")
|
||||||
|
|
||||||
if frappe.db.exists("Custom Field", {"name": doctype + "-resolution_date"}):
|
if frappe.db.exists(
|
||||||
|
"Custom Field", {"name": doctype + "-resolution_date", "fieldname": "resolution_date"}
|
||||||
|
):
|
||||||
rename_fieldname(doctype + "-resolution_date", "sla_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")
|
||||||
|
|||||||
Reference in New Issue
Block a user