Fix hours by employee

This commit is contained in:
Sharoon Thomas 2013-03-11 15:57:05 +00:00
parent 4216ee86ef
commit 80484236ba
1 changed files with 4 additions and 5 deletions

View File

@ -958,15 +958,14 @@ class Project(ModelSQL, ModelView):
key=lambda x: x.create_date
)
timesheet_rows = sorted(
task.timesheet_lines[:], key=lambda x: x.employee
)
timesheet_summary = groupby(timesheet_rows, key=lambda x: x.employee)
hours={}
for line in task.timesheet_lines:
hours[line.employee] = hours.setdefault(line.employee, 0) + line.hours
return render_template(
'project/task.jinja', task=task, active_type_name='render_task_list',
project=task.parent, comments=comments,
timesheet_summary=timesheet_summary
timesheet_summary=hours
)
@login_required