Browse Source

fix: dynamic label for document rename (#18125) (#18129)

(cherry picked from commit fd3df669f7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
version-14
mergify[bot] 2 years ago
committed by GitHub
parent
commit
7f603ac702
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      frappe/public/js/frappe/form/toolbar.js

+ 7
- 1
frappe/public/js/frappe/form/toolbar.js View File

@@ -197,10 +197,16 @@ frappe.ui.form.Toolbar = class Toolbar {

// check if docname is updatable
if (me.can_rename()) {
let label = __("New Name");
if (me.frm.meta.autoname && me.frm.meta.autoname.startsWith("field:")) {
let fieldname = me.frm.meta.autoname.split(":")[1];
label = __("New {0}", [me.frm.get_docfield(fieldname).label]);
}

fields.push(
...[
{
label: __("New Name"),
label: label,
fieldname: "name",
fieldtype: "Data",
reqd: 1,


Loading…
Cancel
Save