From de531ceeb9297728a21d83b8d93fea08708412fa Mon Sep 17 00:00:00 2001 From: Loic Oberle Date: Sat, 23 May 2026 07:58:42 +0200 Subject: [PATCH] refactor(sales_person_wise_transaction_summary): Replace SQL with ORM (#55190) --- .../sales_person_wise_transaction_summary.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py index f8cde141fe4..8966e758fc2 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py @@ -250,8 +250,5 @@ def get_items(filters): def get_item_details(): - item_details = {} - for d in frappe.db.sql("""SELECT `name`, `item_group`, `brand` FROM `tabItem`""", as_dict=1): - item_details.setdefault(d.name, d) - - return item_details + items = frappe.get_all("Item", fields=["name", "item_group", "brand"]) + return {d.name: d for d in items}