From aa684e6f3deb66a41f83ac084a7e39baff124acc 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 (cherry picked from commit 1d1203d5eca07e40d8ce32248a0d81b0d7130627) --- .../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 dba85a9fb6e..f3ded994814 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 204a6df6289..47fe3296cf1 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -850,7 +850,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}