[fix] load tasks in project via __setup__ instead of onload function, to return tasks via get_doc
This commit is contained in:
parent
4cee27eec0
commit
1966225450
@ -13,8 +13,9 @@ class Project(Document):
|
|||||||
def get_feed(self):
|
def get_feed(self):
|
||||||
return '{0}: {1}'.format(_(self.status), self.project_name)
|
return '{0}: {1}'.format(_(self.status), self.project_name)
|
||||||
|
|
||||||
def onload(self):
|
def __setup__(self):
|
||||||
"""Load project tasks for quick view"""
|
"""Load project tasks for quick view"""
|
||||||
|
self.tasks = []
|
||||||
for task in frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc"):
|
for task in frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc"):
|
||||||
self.append("tasks", {
|
self.append("tasks", {
|
||||||
"title": task.subject,
|
"title": task.subject,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user