From 4aa74af90d34bd6220f4b5fdd64ae5dade193413 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 23 Mar 2022 15:29:50 +0530 Subject: [PATCH] fix: ignore items without info for pending qty computation --- erpnext/public/js/utils/serial_no_batch_selector.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js index 5761bb8e35..f484545983 100644 --- a/erpnext/public/js/utils/serial_no_batch_selector.js +++ b/erpnext/public/js/utils/serial_no_batch_selector.js @@ -608,7 +608,10 @@ function check_can_calculate_pending_qty(me) { && doc.fg_completed_qty && erpnext.stock.bom && erpnext.stock.bom.name === doc.bom_no; - const itemChecks = !!item && !item.allow_alternative_item; + const itemChecks = !!item + && !item.allow_alternative_item + && erpnext.stock.bom && erpnext.stock.items + && (item.item_code in erpnext.stock.bom.items); return docChecks && itemChecks; }