fix: if input manualy material request on WO the material_request_item is not set so validate WO give error (#40180)
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py
index fc85712..233ca19 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.py
+++ b/erpnext/manufacturing/doctype/work_order/work_order.py
@@ -791,7 +791,7 @@
)
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]
)