fix: ignore items without info for pending qty computation

(cherry picked from commit 4aa74af90d)
This commit is contained in:
Ankush Menat
2022-03-23 15:29:50 +05:30
committed by Ankush Menat
parent 277c03e157
commit a1740b0762

View File

@@ -606,7 +606,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;
}