From 29c7947db05106cb87a0dfe0905dc3abc8c63cd4 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Thu, 27 Jan 2022 11:11:37 +0530 Subject: [PATCH] fix: Further sort sales_order_analysis to get consistent response Since the data was sorted by `transaction_date`, report sorting order used to be inconsistent everytime if there were lots of records with same transaction date. This used to create problems while exporting report as "Excel" with filters. --- .../selling/report/sales_order_analysis/sales_order_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py b/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py index b2bf5464b5..3e22d0fa8c 100644 --- a/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py +++ b/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py @@ -85,7 +85,7 @@ def get_data(conditions, filters): and so.docstatus = 1 {conditions} GROUP BY soi.name - ORDER BY so.transaction_date ASC + ORDER BY so.transaction_date ASC, soi.item_code ASC """.format(conditions=conditions), filters, as_dict=1) return data