From c413b04539364a8f4e236d51b7cf25163275abed Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 18:34:35 +0530 Subject: [PATCH] fix: incorrect work order status (backport #40407) (#40410) fix: incorrect work order status (#40407) (cherry picked from commit 948297692e8c7467b90883983731b4794b81e81a) Co-authored-by: rohitwaghchaure --- erpnext/manufacturing/doctype/work_order/work_order.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index 77a0c54c734..abaec0f9d4c 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -260,6 +260,13 @@ class WorkOrder(Document): else: status = "Cancelled" + if ( + self.skip_transfer + and self.produced_qty + and self.qty > (flt(self.produced_qty) + flt(self.process_loss_qty)) + ): + status = "In Process" + return status def update_work_order_qty(self):