Browse Source

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 years ago
committed by mergify-bot
parent
commit
f14d9bd3da
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      frappe/public/js/frappe/form/form.js

+ 2
- 0
frappe/public/js/frappe/form/form.js View File

@@ -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…
Cancel
Save