mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 13:42:10 +01:00
fix: key-error for COGS By Item Group report (#47914)
fix: keyerror for COGS By Item Group report
(cherry picked from commit 997ce4eaa7)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -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]:
|
def get_item_groups_map(svd_list: SVDList) -> dict[str, str]:
|
||||||
item_codes = set(i["item_code"] for i in svd_list)
|
item_codes = set(i["item_code"] for i in svd_list)
|
||||||
ig_list = frappe.get_list(
|
return frappe._dict(
|
||||||
"Item", fields=["item_code", "item_group"], filters=[("item_code", "in", item_codes)]
|
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:
|
def get_item_groups_dict() -> ItemGroupsDict:
|
||||||
|
|||||||
Reference in New Issue
Block a user