From b19fd5704355f67ab9f0ecf521e648faefc00ef5 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Fri, 12 Jan 2018 16:28:30 +0530 Subject: [PATCH] [fix] set required quantity if item in bom found (#12460) --- .../manufacturing/doctype/production_order/production_order.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 7c56d97974..7cfbab002a 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -462,7 +462,8 @@ class ProductionOrder(Document): if reset_only_qty: for d in self.get("required_items"): - d.required_qty = item_dict.get(d.item_code).get("qty") + if item_dict.get(d.item_code): + d.required_qty = item_dict.get(d.item_code).get("qty") else: for item in sorted(item_dict.values(), key=lambda d: d['idx']): self.append('required_items', {