[route] refactor, wip

This commit is contained in:
Rushabh Mehta
2014-08-19 16:20:04 +05:30
parent 74bc2baa1d
commit cb067aa579
7 changed files with 744 additions and 739 deletions

View File

@@ -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