fix(UX): reload form after renaming field (#25159)
This commit is contained in:
parent
a15ddf8d1b
commit
af69dab130
2 changed files with 10 additions and 7 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue