order by modified instead of item name (#13113)

This commit is contained in:
Shreya Shah 2018-02-28 18:59:55 +05:30 committed by Nabin Hait
parent 3b43c0d160
commit a310cc7156
2 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ def get_product_list_for_group(product_group=None, start=0, limit=10, search=Non
or I.name like %(search)s)"""
search = "%" + cstr(search) + "%"
query += """order by I.weightage desc, in_stock desc, I.item_name limit %s, %s""" % (start, limit)
query += """order by I.weightage desc, in_stock desc, I.modified desc limit %s, %s""" % (start, limit)
data = frappe.db.sql(query, {"product_group": product_group,"search": search, "today": nowdate()}, as_dict=1)

View File

@ -35,7 +35,7 @@ def get_product_list(search=None, start=0, limit=12):
search = "%" + cstr(search) + "%"
# order by
query += """ order by I.weightage desc, in_stock desc, I.item_name limit %s, %s""" % (cint(start), cint(limit))
query += """ order by I.weightage desc, in_stock desc, I.modified desc limit %s, %s""" % (cint(start), cint(limit))
data = frappe.db.sql(query, {
"search": search,