fix: filter with item group only if it is mentioned in pos profile

(cherry picked from commit 09641073e3)
This commit is contained in:
venkat102
2024-11-22 11:53:07 +05:30
committed by Mergify
parent c0e6f3f4df
commit a4398626f6

View File

@@ -96,6 +96,8 @@ def search_by_term(search_term, warehouse, price_list):
def filter_result_items(result, pos_profile):
if result and result.get("items"):
pos_item_groups = frappe.db.get_all("POS Item Group", {"parent": pos_profile}, pluck="item_group")
if not pos_item_groups:
return
result["items"] = [item for item in result.get("items") if item.get("item_group") in pos_item_groups]