From 1d1203d5eca07e40d8ce32248a0d81b0d7130627 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 28 Feb 2022 12:44:39 +0530 Subject: [PATCH] fix: dont fetch draft/cancelled BOMs --- .../manufacturing/doctype/production_plan/production_plan.js | 2 +- erpnext/manufacturing/doctype/work_order/work_order.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index 0babf875e7..c33e64674e 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -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")); } diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index e1120c723d..374ab86cad 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -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}