mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
Merge pull request #50416 from rohitwaghchaure/fixed-github-46684
fix: work order status
This commit is contained in:
@@ -923,6 +923,10 @@ class JobCard(Document):
|
|||||||
wo.update_operation_status()
|
wo.update_operation_status()
|
||||||
wo.calculate_operating_cost()
|
wo.calculate_operating_cost()
|
||||||
wo.set_actual_dates()
|
wo.set_actual_dates()
|
||||||
|
|
||||||
|
if wo.track_semi_finished_goods and time_data:
|
||||||
|
wo.status = "In Process"
|
||||||
|
|
||||||
wo.save()
|
wo.save()
|
||||||
|
|
||||||
def get_current_operation_data(self):
|
def get_current_operation_data(self):
|
||||||
|
|||||||
@@ -571,6 +571,10 @@ class WorkOrder(Document):
|
|||||||
):
|
):
|
||||||
status = "In Process"
|
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:
|
if status == "Not Started" and self.reserve_stock:
|
||||||
for row in self.required_items:
|
for row in self.required_items:
|
||||||
if not row.stock_reserved_qty:
|
if not row.stock_reserved_qty:
|
||||||
@@ -584,6 +588,11 @@ class WorkOrder(Document):
|
|||||||
|
|
||||||
return status
|
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):
|
def update_work_order_qty(self):
|
||||||
"""Update **Manufactured Qty** and **Material Transferred for Qty** in Work Order
|
"""Update **Manufactured Qty** and **Material Transferred for Qty** in Work Order
|
||||||
based on Stock Entry"""
|
based on Stock Entry"""
|
||||||
|
|||||||
Reference in New Issue
Block a user