From 00ad515ac7af9950113c207918ea3be3cea30ff6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 17:16:31 +0530 Subject: [PATCH] fix: use `name` for links not `item_code` (backport #30462) (#30463) * fix: use `name` for links not `item_code` (#30462) (cherry picked from commit 76dce2eddc69a1df8277028510a9dbe6ab4acd7d) # Conflicts: # erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py * fix: conflicts Co-authored-by: Ankush Menat --- .../item_wise_sales_history/item_wise_sales_history.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py index 56e1eb57b81..f0684f71cd7 100644 --- a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py +++ b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py @@ -210,14 +210,12 @@ def get_customer_details(): return customer_details def get_item_details(): - details = frappe.db.get_all("Item", - fields=["item_code", "item_name", "item_group"]) + details = frappe.db.get_all("Item", fields=["name", "item_name", "item_group"]) item_details = {} for d in details: - item_details.setdefault(d.item_code, frappe._dict({ - "item_name": d.item_name, - "item_group": d.item_group - })) + item_details.setdefault( + d.name, frappe._dict({"item_name": d.item_name, "item_group": d.item_group}) + ) return item_details def get_sales_order_details(company_list, filters):