Merge branch 'development' into 'master'

Report subproject updated based on new timesheet field

See merge request prakash.jain/cor-odoo!151
This commit is contained in:
prakash.jain 2021-03-09 05:33:32 -08:00
commit d9a1a8166e
2 changed files with 6 additions and 5 deletions

View File

@ -15,17 +15,17 @@ class ProjectTimelineReport(models.Model):
start_date = fields.Date(string='Start Time', readonly=True)
employee_id = fields.Many2one('hr.employee', string='Employee', readonly=True)
project_id = fields.Many2one('project.project', string='Project', readonly=True)
#sub_project = fields.Many2one('project.project', string='Sub Project', readonly=True)
sub_project = fields.Many2one('project.project', string='Sub Project', readonly=True)
duration = fields.Float('Duration', readonly=True)
timestamp = fields.Char('Timestamp', readonly=True)
task_id = fields.Many2one('project.task', string='Task', readonly=True)
description = fields.Char('Description', readonly=True)
sub_project = fields.Many2many('project.project', compute='_compute_related_subproject')
#sub_project = fields.Many2many('project.project', compute='_compute_related_subproject')
@api.depends('project_id')
"""@api.depends('project_id')
def _compute_related_subproject(self):
for val in self:
val.sub_project = val.project_id.sub_project.ids
val.sub_project = val.project_id.sub_project.ids"""
@api.model
def export_data(self, fields):
@ -73,6 +73,7 @@ class ProjectTimelineReport(models.Model):
start_datetime::date as start_date,
employee_id,
project_id,
sub_project,
unit_amount as duration,
CONCAT(to_char(start_datetime at time zone 'utc', 'HH24:MI'), '-', to_char(end_datetime at time zone 'utc', 'HH24:MI')) as timestamp,
task_id,

View File

@ -10,7 +10,7 @@
<field name="start_date"/>
<field name="employee_id"/>
<field name="project_id"/>
<field name="sub_project" widget="many2many_tags"/>
<field name="sub_project"/>
<field name="task_id"/>
<field name="duration"/>
<field name="timestamp"/>