[fix] load tasks in project via __setup__ instead of onload function, to return tasks via get_doc

This commit is contained in:
Nabin Hait 2015-06-11 15:31:23 +05:30
parent 4cee27eec0
commit 1966225450

View File

@ -13,8 +13,9 @@ class Project(Document):
def get_feed(self):
return '{0}: {1}'.format(_(self.status), self.project_name)
def onload(self):
def __setup__(self):
"""Load project tasks for quick view"""
self.tasks = []
for task in frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc"):
self.append("tasks", {
"title": task.subject,