mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
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:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user