From 352c585ef5161af7a9a26b77d23dc8afe02a5c73 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. (cherry picked from commit 29c7947db05106cb87a0dfe0905dc3abc8c63cd4) --- .../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 c530d30c0c2..001095588ba 100644 --- a/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py +++ b/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py @@ -80,7 +80,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