Merge pull request #51587 from frappe/mergify/bp/version-15-hotfix/pr-51585

fix: closed WO becomes open when RM is returned (backport #51585)
This commit is contained in:
Mihir Kandoi
2026-01-08 14:38:34 +05:30
committed by GitHub

View File

@@ -351,15 +351,16 @@ class WorkOrder(Document):
def update_status(self, status=None):
"""Update status of work order if unknown"""
if status != "Stopped" and status != "Closed":
status = self.get_status(status)
if self.status != "Closed":
if status not in ["Stopped", "Closed"]:
status = self.get_status(status)
if status != self.status:
self.db_set("status", status)
if status != self.status:
self.db_set("status", status)
self.update_required_items()
self.update_required_items()
return status
return status or self.status
def get_status(self, status=None):
"""Return the status based on stock entries against this work order"""