[route] refactor, wip
This commit is contained in:
@@ -65,9 +65,11 @@ class StatusUpdater(Document):
|
||||
self.validate_qty()
|
||||
|
||||
def set_status(self, update=False):
|
||||
if self.get("__islocal"):
|
||||
if self.is_new():
|
||||
return
|
||||
|
||||
_status = self.status
|
||||
|
||||
if self.doctype in status_map:
|
||||
sl = status_map[self.doctype][:]
|
||||
sl.reverse()
|
||||
@@ -83,9 +85,11 @@ class StatusUpdater(Document):
|
||||
self.status = s[0]
|
||||
break
|
||||
|
||||
if self.status != _status:
|
||||
self.add_comment("Label", self.status)
|
||||
|
||||
if update:
|
||||
frappe.db.set_value(self.doctype, self.name, "status", self.status)
|
||||
self.add_comment("Label", self.status)
|
||||
|
||||
def on_communication(self):
|
||||
if not self.get("communications"): return
|
||||
|
||||
Reference in New Issue
Block a user