fix: ignore items without info for pending qty computation

This commit is contained in:
Ankush Menat 2022-03-23 15:29:50 +05:30 committed by Ankush Menat
parent be16fb9dbb
commit 4aa74af90d

View File

@ -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;
}