Skip to content

Commit

Permalink
fix: refresh fields after frm.set_read_only (frappe#26998)
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Jul 18, 2024
1 parent 053ad46 commit 284af15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frappe/public/js/frappe/form/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ frappe.ui.form.Form = class FrappeForm {
// read only (workflow)
this.read_only = frappe.workflow.is_read_only(this.doctype, this.docname);
if (this.read_only) {
this.set_read_only(true);
this.set_read_only();
frappe.show_alert(__("This form is not editable due to a Workflow."));
}

Expand Down Expand Up @@ -671,6 +671,10 @@ frappe.ui.form.Form = class FrappeForm {
}

refresh_fields() {
if (this.layout === undefined) {
return;
}

this.layout.refresh(this.doc);
this.layout.primary_button = this.$wrapper.find(".btn-primary");

Expand Down Expand Up @@ -1843,6 +1847,7 @@ frappe.ui.form.Form = class FrappeForm {
email: p.email,
};
});
this.refresh_fields();
}

trigger(event, doctype, docname) {
Expand Down

0 comments on commit 284af15

Please sign in to comment.