fix: dont fetch draft/cancelled BOMs

This commit is contained in:
Ankush Menat 2022-02-28 12:44:39 +05:30 committed by Ankush Menat
parent 3cc47d5ba5
commit 1d1203d5ec
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ frappe.ui.form.on('Production Plan', {
if (d.item_code) {
return {
query: "erpnext.controllers.queries.bom",
filters:{'item': cstr(d.item_code)}
filters:{'item': cstr(d.item_code), 'docstatus': 1}
}
} else frappe.msgprint(__("Please enter Item first"));
}

View File

@ -854,7 +854,7 @@ def get_item_details(item, project = None, skip_bom_info=False):
res = res[0]
if skip_bom_info: return res
filters = {"item": item, "is_default": 1}
filters = {"item": item, "is_default": 1, "docstatus": 1}
if project:
filters = {"item": item, "project": project}