mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 19:55:05 +00:00
fix: closed WO becomes open when RM is returned
(cherry picked from commit d0ba365aaa)
This commit is contained in:
@@ -351,15 +351,16 @@ class WorkOrder(Document):
|
|||||||
|
|
||||||
def update_status(self, status=None):
|
def update_status(self, status=None):
|
||||||
"""Update status of work order if unknown"""
|
"""Update status of work order if unknown"""
|
||||||
if status != "Stopped" and status != "Closed":
|
if self.status != "Closed":
|
||||||
status = self.get_status(status)
|
if status not in ["Stopped", "Closed"]:
|
||||||
|
status = self.get_status(status)
|
||||||
|
|
||||||
if status != self.status:
|
if status != self.status:
|
||||||
self.db_set("status", 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):
|
def get_status(self, status=None):
|
||||||
"""Return the status based on stock entries against this work order"""
|
"""Return the status based on stock entries against this work order"""
|
||||||
|
|||||||
Reference in New Issue
Block a user