flectra/addons/hr_timesheet/report/project_report.py

34 lines
1.2 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2018-01-16 11:34:37 +01:00
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
2018-01-16 11:34:37 +01:00
from flectra import fields, models
class ReportProjectTaskUser(models.Model):
_inherit = "report.project.task.user"
hours_planned = fields.Float('Planned Hours', readonly=True)
hours_effective = fields.Float('Effective Hours', readonly=True)
hours_delay = fields.Float('Avg. Plan.-Eff.', readonly=True)
remaining_hours = fields.Float('Remaining Hours', readonly=True)
progress = fields.Float('Progress', group_operator='avg', readonly=True)
total_hours = fields.Float('Total Hours', readonly=True)
def _select(self):
return super(ReportProjectTaskUser, self)._select() + """,
progress as progress,
t.effective_hours as hours_effective,
remaining_hours as remaining_hours,
total_hours as total_hours,
t.delay_hours as hours_delay,
planned_hours as hours_planned"""
def _group_by(self):
return super(ReportProjectTaskUser, self)._group_by() + """,
remaining_hours,
t.effective_hours,
progress,
total_hours,
planned_hours,
hours_delay"""