Explorar el Código

fix: reshuffle __newname field to accommodate under 1st Tab Break (#18406) (#18427)

* fix: reshuffle __newname field to accommodate under 1st Tab Break

* fix: handle empty condition

(cherry picked from commit 35995f0153)

Co-authored-by: Saurabh <saurabh6790@gmail.com>
version-14
mergify[bot] hace 2 años
committed by GitHub
padre
commit
f833e5d52a
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 4AEE18F83AFDEB23
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. +9
    -1
      frappe/public/js/frappe/form/layout.js

+ 9
- 1
frappe/public/js/frappe/form/layout.js Ver fichero

@@ -141,8 +141,16 @@ frappe.ui.form.Layout = class Layout {
fieldname: "__details",
};
let first_tab = this.fields[1].fieldtype === "Tab Break" ? this.fields[1] : null;

if (!first_tab) {
this.fields.splice(1, 0, default_tab);
this.fields.splice(0, 0, default_tab);
} else {
// reshuffle __newname field to accomodate under 1st Tab Break
let newname_field = this.fields.find((df) => df.fieldname === "__newname");
if (newname_field && newname_field.get_status(this) === "Write") {
this.fields.splice(0, 1);
this.fields.splice(1, 0, newname_field);
}
}
}



Cargando…
Cancelar
Guardar