瀏覽代碼

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] 2 年之前
committed by GitHub
父節點
當前提交
f833e5d52a
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. +9
    -1
      frappe/public/js/frappe/form/layout.js

+ 9
- 1
frappe/public/js/frappe/form/layout.js 查看文件

@@ -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);
}
}
}



Loading…
取消
儲存