fix: use name for links not item_code (backport #30462) (#30463)

* fix: use `name` for links not `item_code` (#30462)

(cherry picked from commit 76dce2eddc)

# Conflicts:
#	erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py

* fix: conflicts

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot]
2022-03-29 17:16:31 +05:30
committed by GitHub
parent 6b3bdb2e9e
commit 00ad515ac7

View File

@@ -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):