diff --git a/erpnext/accounts/doctype/cost_center/cost_center.json b/erpnext/accounts/doctype/cost_center/cost_center.json index 092f701332b3e414063bcd57ad03dfb9e542e3d6..1a267bab8a029c5af19549148fb45795c48e169c 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.json +++ b/erpnext/accounts/doctype/cost_center/cost_center.json @@ -41,7 +41,7 @@ "in_list_view": 1, "in_standard_filter": 1, "label": "Cost Center Number", - "read_only": 1 + "read_only_depends_on": "eval:!doc.__islocal" }, { "fieldname": "parent_cost_center", diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 937758f8c3779308cd99e4dfea1c130bd9919fb5..0f4be003f433bce9e8a7588b0c5d7d228de8f8f4 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -1210,7 +1210,8 @@ def update_cost_center(docname, cost_center_name, cost_center_number, company, m Renames the document by adding the number as a prefix to the current name and updates all transaction where it was present. """ - validate_field_number("Cost Center", docname, cost_center_number, company, "cost_center_number") + if not merge: + validate_field_number("Cost Center", docname, cost_center_number, company, "cost_center_number") if cost_center_number: frappe.db.set_value("Cost Center", docname, "cost_center_number", cost_center_number.strip())