Skip to content

Commit

Permalink
perf: remove useless sorting on docstatus (#25571) (#25590)
Browse files Browse the repository at this point in the history
(cherry picked from commit a12fc11)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Mar 22, 2024
1 parent 68d6947 commit 5e65cc9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions frappe/model/db_query.py
Expand Up @@ -1079,11 +1079,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

0 comments on commit 5e65cc9

Please sign in to comment.