Skip to content

Commit

Permalink
fix: Skip virtual fields in all select queries (#26700)
Browse files Browse the repository at this point in the history
(cherry picked from commit 820a6ed)
  • Loading branch information
ankush authored and mergify[bot] committed Jun 6, 2024
1 parent 9c33352 commit fcb2f18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frappe/desk/reportview.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def update_wildcard_field_param(data):
isinstance(data.fields, list | tuple) and len(data.fields) == 1 and data.fields[0] == "*"
):
parent_type = data.parenttype or data.parent_doctype
data.fields = get_permitted_fields(data.doctype, parenttype=parent_type)
data.fields = get_permitted_fields(data.doctype, parenttype=parent_type, ignore_virtual=True)
return True

return False
Expand Down
2 changes: 1 addition & 1 deletion frappe/model/db_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def apply_fieldlevel_read_permissions(self):

if wrap_grave_quotes(table) in self.query_tables:
permitted_child_table_fields = get_permitted_fields(
doctype=ch_doctype, parenttype=self.doctype
doctype=ch_doctype, parenttype=self.doctype, ignore_virtual=True
)
if column in permitted_child_table_fields or column in optional_fields:
continue
Expand Down

0 comments on commit fcb2f18

Please sign in to comment.