diff --git a/addons/hr_timesheet/models/hr_timesheet.py b/addons/hr_timesheet/models/hr_timesheet.py index 200b4a0a84e..1fcfc4a70d0 100644 --- a/addons/hr_timesheet/models/hr_timesheet.py +++ b/addons/hr_timesheet/models/hr_timesheet.py @@ -14,6 +14,8 @@ class AccountAnalyticLine(models.Model): @api.model def default_get(self, field_list): result = super(AccountAnalyticLine, self).default_get(field_list) + if 'encoding_uom_id' in field_list: + result['encoding_uom_id'] = self.env.company.timesheet_encode_uom_id.id if not self.env.context.get('default_employee_id') and 'employee_id' in field_list and result.get('user_id'): result['employee_id'] = self.env['hr.employee'].search([('user_id', '=', result['user_id'])], limit=1).id return result @@ -23,6 +25,11 @@ class AccountAnalyticLine(models.Model): employee_id = fields.Many2one('hr.employee', "Employee") department_id = fields.Many2one('hr.department', "Department", compute='_compute_department_id', store=True, compute_sudo=True) + encoding_uom_id = fields.Many2one('uom.uom', compute='_compute_encoding_uom_id') + + def _compute_encoding_uom_id(self): + for analytic_line in self: + analytic_line.encoding_uom_id = self.env.company.timesheet_encode_uom_id @api.onchange('project_id') def onchange_project_id(self): diff --git a/addons/hr_timesheet/report/hr_timesheet_report_view.xml b/addons/hr_timesheet/report/hr_timesheet_report_view.xml index 49c25a8e63f..668ffd7c62c 100644 --- a/addons/hr_timesheet/report/hr_timesheet_report_view.xml +++ b/addons/hr_timesheet/report/hr_timesheet_report_view.xml @@ -2,7 +2,7 @@ - By Employee + Timesheets By Employee account.analytic.line [('project_id', '!=', False)] {'search_default_groupby_employee':1,} @@ -25,6 +25,13 @@ + + + graph + + + + tree @@ -40,7 +47,7 @@ - By Project + Timesheets By Project account.analytic.line [('project_id', '!=', False)] {'search_default_groupby_project':1,} @@ -63,6 +70,13 @@ + + + graph + + + + tree @@ -78,10 +92,10 @@ - By Task + Timesheets By Task account.analytic.line [('project_id', '!=', False)] - {'search_default_groupby_task':1,} + {'search_default_groupby_project':1,'search_default_groupby_task':1,}

@@ -101,6 +115,13 @@ + + + graph + + + + tree @@ -122,7 +143,7 @@ sequence="99"/> diff --git a/addons/hr_timesheet/views/hr_timesheet_views.xml b/addons/hr_timesheet/views/hr_timesheet_views.xml index 700feb230fe..9aef1401601 100644 --- a/addons/hr_timesheet/views/hr_timesheet_views.xml +++ b/addons/hr_timesheet/views/hr_timesheet_views.xml @@ -24,7 +24,7 @@ - + @@ -57,6 +57,18 @@ + + account.analytic.line.graph + account.analytic.line + + + + + + + + + account.analytic.line.form account.analytic.line @@ -68,7 +80,7 @@ - + diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index 9b2f80529ae..725cffbbb71 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -265,11 +265,22 @@ + + + + + + project.project.view.form.simplified + project.project + + primary + +

- +
@@ -277,7 +288,7 @@ Create a Project project.project form - + new diff --git a/addons/sale_timesheet/views/hr_timesheet_views.xml b/addons/sale_timesheet/views/hr_timesheet_views.xml index 4a1f0d45619..64a5f86b1f5 100644 --- a/addons/sale_timesheet/views/hr_timesheet_views.xml +++ b/addons/sale_timesheet/views/hr_timesheet_views.xml @@ -33,7 +33,7 @@ Reporting --> - By Billing Rate + Timesheets By Billing Rate account.analytic.line pivot,graph [('project_id', '!=', False)] diff --git a/addons/uom/data/uom_data.xml b/addons/uom/data/uom_data.xml index 5021eb495ba..badda0920c1 100644 --- a/addons/uom/data/uom_data.xml +++ b/addons/uom/data/uom_data.xml @@ -52,6 +52,7 @@ smaller + Days