diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index 367548864c3..683ce626bc1 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -923,6 +923,10 @@ class JobCard(Document): wo.update_operation_status() wo.calculate_operating_cost() wo.set_actual_dates() + + if wo.track_semi_finished_goods and time_data: + wo.status = "In Process" + wo.save() def get_current_operation_data(self): diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index 4cfd8232d88..6bc0dde543d 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -571,6 +571,10 @@ class WorkOrder(Document): ): status = "In Process" + if self.track_semi_finished_goods and status != "Completed": + if op_status := self.get_status_based_on_operation(): + status = op_status + if status == "Not Started" and self.reserve_stock: for row in self.required_items: if not row.stock_reserved_qty: @@ -584,6 +588,11 @@ class WorkOrder(Document): return status + def get_status_based_on_operation(self): + for row in self.operations: + if row.status != "Completed": + return "In Process" + def update_work_order_qty(self): """Update **Manufactured Qty** and **Material Transferred for Qty** in Work Order based on Stock Entry"""