fix: added is_stock_item filter (#25530)

This commit is contained in:
Noah Jacob 2021-05-06 19:42:01 +05:30 committed by GitHub
parent 134eaa5786
commit 4ecae62194
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -29,7 +29,10 @@ frappe.ui.form.on("BOM", {
frm.set_query("item", function() {
return {
query: "erpnext.manufacturing.doctype.bom.bom.item_query"
query: "erpnext.manufacturing.doctype.bom.bom.item_query",
filters: {
"is_stock_item": 1
}
};
});

View File

@ -973,6 +973,9 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
if not has_variants:
query_filters["has_variants"] = 0
if filters and filters.get("is_stock_item"):
query_filters["is_stock_item"] = 1
return frappe.get_all("Item",
fields = fields, filters=query_filters,
or_filters = or_cond_filters, order_by=order_by,