fix: key-error for COGS By Item Group report (#47914)

fix: keyerror for COGS By Item Group report
This commit is contained in:
rohitwaghchaure
2025-06-05 15:59:23 +05:30
committed by GitHub
parent 7720163e4c
commit 997ce4eaa7

View File

@@ -159,10 +159,11 @@ def assign_item_groups_to_svd_list(svd_list: SVDList) -> None:
def get_item_groups_map(svd_list: SVDList) -> dict[str, str]:
item_codes = set(i["item_code"] for i in svd_list)
ig_list = frappe.get_list(
"Item", fields=["item_code", "item_group"], filters=[("item_code", "in", item_codes)]
return frappe._dict(
frappe.get_all(
"Item", fields=["name", "item_group"], filters=[("name", "in", item_codes)], as_list=True
)
)
return {i["item_code"]: i["item_group"] for i in ig_list}
def get_item_groups_dict() -> ItemGroupsDict: