Minor fix
This commit is contained in:
parent
1f994d31b8
commit
3e18bfded9
1 changed files with 5 additions and 4 deletions
|
|
@ -317,13 +317,14 @@ class DatabaseQuery(object):
|
|||
) and not self.group_by)
|
||||
|
||||
if not group_function_without_group_by:
|
||||
|
||||
args.order_by = "`tab{0}`.`{1}` {2}".format(self.doctype,
|
||||
meta.sort_field or "modified", meta.sort_order or "desc")
|
||||
if args.get("sort_field") and args.get("sort_order"):
|
||||
args.order_by = "`tab{0}`.`{1}` {2}".format(self.doctype,
|
||||
meta.sort_field or "modified", meta.sort_order or "desc")
|
||||
|
||||
# draft docs always on top
|
||||
if meta.is_submittable:
|
||||
args.order_by = "`tab{0}`.docstatus asc, ".format(self.doctype) + args.order_by
|
||||
args.order_by = "`tab{0}`.docstatus asc {1}"\
|
||||
.format(self.doctype, (", " + args.order_by if args.order_by else ""))
|
||||
|
||||
def check_sort_by_table(self, order_by):
|
||||
if "." in order_by:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue