From 22ff462abbaa93989c2afa2c492aab898b72e00f Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 3 Feb 2022 15:25:34 +0530 Subject: [PATCH] fix: add default if qty is not found --- erpnext/manufacturing/doctype/work_order/work_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index fc72639be68..c5daba58c3d 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -449,7 +449,7 @@ class WorkOrder(Document): def update_ordered_qty(self): if self.production_plan and self.production_plan_item: - qty = frappe.get_value("Production Plan Item", self.production_plan_item, "ordered_qty") + qty = frappe.get_value("Production Plan Item", self.production_plan_item, "ordered_qty") or 0.0 if self.docstatus == 1: qty += self.qty