fix(bom): remove manual permission checking (#26689) (#26690)

get_list does the permission checking.

(cherry picked from commit d95f16ac8f)

Co-authored-by: Ankush <ankush@iwebnotes.com>
This commit is contained in:
Frappe PR Bot 2021-07-28 18:11:11 +05:30 committed by GitHub
parent 4c0dfdb398
commit 1b6dd84c0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1069,13 +1069,6 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
if barcodes: if barcodes:
or_cond_filters["name"] = ("in", barcodes) or_cond_filters["name"] = ("in", barcodes)
for cond in get_match_cond(doctype, as_condition=False):
for key, value in cond.items():
if key == doctype:
key = "name"
query_filters[key] = ("in", value)
if filters and filters.get("item_code"): if filters and filters.get("item_code"):
has_variants = frappe.get_cached_value("Item", filters.get("item_code"), "has_variants") has_variants = frappe.get_cached_value("Item", filters.get("item_code"), "has_variants")
if not has_variants: if not has_variants:
@ -1084,7 +1077,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
if filters and filters.get("is_stock_item"): if filters and filters.get("is_stock_item"):
query_filters["is_stock_item"] = 1 query_filters["is_stock_item"] = 1
return frappe.get_all("Item", return frappe.get_list("Item",
fields = fields, filters=query_filters, fields = fields, filters=query_filters,
or_filters = or_cond_filters, order_by=order_by, or_filters = or_cond_filters, order_by=order_by,
limit_start=start, limit_page_length=page_len, as_list=1) limit_start=start, limit_page_length=page_len, as_list=1)