diff --git a/rigpl_erpnext/rigpl_erpnext/report/standards_and_drawings_rigpl/standards_and_drawings_rigpl.py b/rigpl_erpnext/rigpl_erpnext/report/standards_and_drawings_rigpl/standards_and_drawings_rigpl.py index 3599b9f6..436a2264 100644 --- a/rigpl_erpnext/rigpl_erpnext/report/standards_and_drawings_rigpl/standards_and_drawings_rigpl.py +++ b/rigpl_erpnext/rigpl_erpnext/report/standards_and_drawings_rigpl/standards_and_drawings_rigpl.py @@ -29,13 +29,13 @@ def get_data(filters): query = """SELECT idoc.name, idoc.drawing_based_on, idoc.customer, idoc.sales_order, idoc.item, idoc.description, idoc.remarks, idoc.docstatus FROM `tabImportant Documents` idoc - WHERE %s"""%(conditions) + WHERE %s ORDER BY idoc.drawing_based_on, idoc.customer, idoc.items"""%(conditions) data = frappe.db.sql(query, as_list=1) else: query = """SELECT idoc.name, idoc.standard_authority, idoc.standard_number, idoc.category_name, idoc.standard_year, idoc.committee, idoc.description, idoc.remarks, idoc.docstatus FROM `tabImportant Documents` idoc - WHERE %s"""%(conditions) + WHERE %s ORDER BY idoc.category_name, idoc.standard_authority, idoc.standard_number"""%(conditions) data = frappe.db.sql(query, as_list=1) return data