From f24f51b7de93b665bdb0ec8b7f5598667438b9f0 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Tue, 12 Mar 2024 17:23:21 +0100 Subject: [PATCH] fix: if input manualy material request on WO the material_request_item is not set so validate WO give error (#40180) --- 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 fc85712efaf..233ca19f7ed 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -791,7 +791,7 @@ class WorkOrder(Document): ) def update_completed_qty_in_material_request(self): - if self.material_request: + if self.material_request and self.material_request_item: frappe.get_doc("Material Request", self.material_request).update_completed_qty( [self.material_request_item] )