Skip to content

Commit

Permalink
fix(js): Handle hidden virtual fields (#24405) (#24691)
Browse files Browse the repository at this point in the history
(cherry picked from commit 766a7ef)

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
  • Loading branch information
mergify[bot] and cogk committed Feb 2, 2024
1 parent afd357b commit 50c18ab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions frappe/public/js/frappe/form/controls/base_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ frappe.ui.form.Control = class BaseControl {
if (this.df.get_status) {
return this.df.get_status(this);
}
if (this.df.is_virtual) {
return "Read";
}

if (
(!this.doctype && !this.docname) ||
Expand Down
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/model/perm.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ $.extend(frappe.perm, {

if (!perm) {
let is_hidden = df && (cint(df.hidden) || cint(df.hidden_due_to_dependency));
let is_read_only = df && cint(df.read_only);
let is_read_only = df && (cint(df.read_only) || cint(df.is_virtual));
return is_hidden ? "None" : is_read_only ? "Read" : "Write";
}

Expand Down

0 comments on commit 50c18ab

Please sign in to comment.