Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: remove useless sorting on docstatus (backport #25571) #25591

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions frappe/model/db_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,11 +1097,6 @@ def set_order_by(self, args):
f"`tab{self.doctype}`.`{sort_field or 'modified'}` {sort_order or 'desc'}"
)

# draft docs always on top
if hasattr(self.doctype_meta, "is_submittable") and self.doctype_meta.is_submittable:
if self.order_by:
args.order_by = f"`tab{self.doctype}`.docstatus asc, {args.order_by}"

def validate_order_by_and_group_by(self, parameters: str):
"""Check order by, group by so that atleast one column is selected and does not have subquery"""
if not parameters:
Expand Down