diff --git a/frappe/custom/doctype/custom_field/custom_field.js b/frappe/custom/doctype/custom_field/custom_field.js index d0c61b6d8c..c7c86c0077 100644 --- a/frappe/custom/doctype/custom_field/custom_field.js +++ b/frappe/custom/doctype/custom_field/custom_field.js @@ -123,13 +123,15 @@ frappe.ui.form.on("Custom Field", { default: frm.doc.fieldname, }, function (data) { - frappe.call({ - method: "frappe.custom.doctype.custom_field.custom_field.rename_fieldname", - args: { - custom_field: frm.doc.name, - fieldname: data.fieldname, - }, - }); + frappe + .xcall( + "frappe.custom.doctype.custom_field.custom_field.rename_fieldname", + { + custom_field: frm.doc.name, + fieldname: data.fieldname, + } + ) + .then(() => frm.reload()); }, __("Rename Fieldname"), __("Rename") diff --git a/frappe/custom/doctype/custom_field/custom_field.py b/frappe/custom/doctype/custom_field/custom_field.py index 9802839556..2d9fbe00f8 100644 --- a/frappe/custom/doctype/custom_field/custom_field.py +++ b/frappe/custom/doctype/custom_field/custom_field.py @@ -370,6 +370,7 @@ def rename_fieldname(custom_field: str, fieldname: str): field.db_set("fieldname", field.fieldname, notify=True) _update_fieldname_references(field, old_fieldname, new_fieldname) + frappe.msgprint(_("Custom field renamed to {0} successfully.").format(fieldname), alert=True) frappe.db.commit() frappe.clear_cache()