fix: use `name` for links not `item_code` (#30462)
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 da00984..12ca7b3 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
@@ -177,11 +177,11 @@
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})
+ d.name, frappe._dict({"item_name": d.item_name, "item_group": d.item_group})
)
return item_details