瀏覽代碼

fix: refresh form section while refreshing the field

If all the fields with in a section has depends_on property and in such
case section itself stays hidden as all fields with in it are hidden.

Currently when any form field is updated, we are refreshing only the
fields but not the sections. So, field refresh is not affecting the form
because of section being hidden.

Fix is to refresh the sections when ever form fields are refreshed.

(cherry picked from commit 20c6e24a9f)
version-14
leela 4 年之前
committed by mergify-bot
父節點
當前提交
f14d9bd3da
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. +2
    -0
      frappe/public/js/frappe/form/form.js

+ 2
- 0
frappe/public/js/frappe/form/form.js 查看文件

@@ -175,6 +175,7 @@ frappe.ui.form.Form = class FrappeForm {
field && ["Link", "Dynamic Link"].includes(field.df.fieldtype) && field.validate && field.validate(value);

me.layout.refresh_dependency();
me.layout.refresh_sections();
let object = me.script_manager.trigger(fieldname, doc.doctype, doc.name);
return object;
}
@@ -1078,6 +1079,7 @@ frappe.ui.form.Form = class FrappeForm {
if (this.fields_dict[fname] && this.fields_dict[fname].refresh) {
this.fields_dict[fname].refresh();
this.layout.refresh_dependency();
this.layout.refresh_sections();
}
}



Loading…
取消
儲存