From a5e6763be593280bd1b4cfa6de81624532947839 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:56:14 +0530 Subject: [PATCH] fix: if input manualy material request on WO the material_request_item is not set so validate WO give error (backport #40180) (#40421) fix: if input manualy material request on WO the material_request_item is not set so validate WO give error (#40180) (cherry picked from commit f24f51b7de93b665bdb0ec8b7f5598667438b9f0) Co-authored-by: HENRY Florian --- 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 e5746c2fd78..024a631ab11 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] )