use events and projects also as subtasks for work statement report
This commit is contained in:
parent
0a1d2ec262
commit
0812b3975b
1 changed files with 7 additions and 5 deletions
|
@ -170,8 +170,8 @@ class WorkReportInstance(ReportInstance):
|
||||||
@property
|
@property
|
||||||
def queryCriteria(self):
|
def queryCriteria(self):
|
||||||
form = self.view.request.form
|
form = self.view.request.form
|
||||||
crit = self.context.queryCriteria
|
crit = self.context.queryCriteria or []
|
||||||
if crit is None:
|
if not crit and 'tasks' not in form:
|
||||||
f = self.fields['tasks']
|
f = self.fields['tasks']
|
||||||
tasks = baseObject(self.context).getChildren([self.hasReportPredicate])
|
tasks = baseObject(self.context).getChildren([self.hasReportPredicate])
|
||||||
tasks = [util.getUidForObject(task) for task in tasks]
|
tasks = [util.getUidForObject(task) for task in tasks]
|
||||||
|
@ -203,14 +203,16 @@ class WorkReportInstance(ReportInstance):
|
||||||
def getAllSubtasks(self, concept):
|
def getAllSubtasks(self, concept):
|
||||||
result = []
|
result = []
|
||||||
for c in concept.getChildren():
|
for c in concept.getChildren():
|
||||||
if c.conceptType == self.taskType:
|
if c.conceptType in self.taskTypes:
|
||||||
result.append(c)
|
result.append(c)
|
||||||
result.extend(self.getAllSubtasks(c))
|
result.extend(self.getAllSubtasks(c))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def taskType(self):
|
def taskTypes(self):
|
||||||
return self.conceptManager['task']
|
return (self.conceptManager['task'],
|
||||||
|
self.conceptManager['event'],
|
||||||
|
self.conceptManager['project'])
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def workItems(self):
|
def workItems(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue