From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- addons/hr_timesheet/report/__init__.py | 1 + .../report/hr_timesheet_report_view.xml | 164 +++++++++++++++++++++ addons/hr_timesheet/report/project_report.py | 28 ++++ addons/hr_timesheet/report/project_report_view.xml | 18 +++ .../report/report_timesheet_templates.xml | 96 ++++++++++++ 5 files changed, 307 insertions(+) create mode 100644 addons/hr_timesheet/report/__init__.py create mode 100644 addons/hr_timesheet/report/hr_timesheet_report_view.xml create mode 100644 addons/hr_timesheet/report/project_report.py create mode 100644 addons/hr_timesheet/report/project_report_view.xml create mode 100644 addons/hr_timesheet/report/report_timesheet_templates.xml (limited to 'addons/hr_timesheet/report') diff --git a/addons/hr_timesheet/report/__init__.py b/addons/hr_timesheet/report/__init__.py new file mode 100644 index 00000000..e56203fb --- /dev/null +++ b/addons/hr_timesheet/report/__init__.py @@ -0,0 +1 @@ +from . import project_report diff --git a/addons/hr_timesheet/report/hr_timesheet_report_view.xml b/addons/hr_timesheet/report/hr_timesheet_report_view.xml new file mode 100644 index 00000000..1ae8aa59 --- /dev/null +++ b/addons/hr_timesheet/report/hr_timesheet_report_view.xml @@ -0,0 +1,164 @@ + + + + + Timesheets By Employee + account.analytic.line + [('project_id', '!=', False)] + {'search_default_groupby_employee':1,} + + +

+ No activities found. +

+ Track your working hours by projects every day and invoice this time to your customers. +

+
+
+ + + + pivot + + + + + + + graph + + + + + + + tree + + + + + + + form + + + + + + Timesheets By Project + account.analytic.line + [('project_id', '!=', False)] + {'search_default_groupby_project': 1} + + +

+ No activities found. +

+ Track your working hours by projects every day and invoice this time to your customers. +

+
+
+ + + + pivot + + + + + + + graph + + + + + + + tree + + + + + + + form + + + + + + Timesheets By Task + account.analytic.line + [('project_id', '!=', False)] + {'search_default_groupby_project':1,'search_default_groupby_task':1,} + + +

+ No activities found. +

+ Track your working hours by projects every day and invoice this time to your customers. +

+
+
+ + + + pivot + + + + + + + graph + + + + + + + tree + + + + + + + form + + + + + + + + + + + + + + +
+
diff --git a/addons/hr_timesheet/report/project_report.py b/addons/hr_timesheet/report/project_report.py new file mode 100644 index 00000000..85a5e433 --- /dev/null +++ b/addons/hr_timesheet/report/project_report.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo 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) + remaining_hours = fields.Float('Remaining Hours', readonly=True) + progress = fields.Float('Progress', group_operator='avg', readonly=True) + + def _select(self): + return super(ReportProjectTaskUser, self)._select() + """, + progress as progress, + t.effective_hours as hours_effective, + t.planned_hours - t.effective_hours - t.subtask_effective_hours as remaining_hours, + planned_hours as hours_planned""" + + def _group_by(self): + return super(ReportProjectTaskUser, self)._group_by() + """, + remaining_hours, + t.effective_hours, + progress, + planned_hours + """ diff --git a/addons/hr_timesheet/report/project_report_view.xml b/addons/hr_timesheet/report/project_report_view.xml new file mode 100644 index 00000000..d62fb501 --- /dev/null +++ b/addons/hr_timesheet/report/project_report_view.xml @@ -0,0 +1,18 @@ + + + + + report.project.task.user.graph.inherited + report.project.task.user + + + + + + + + + + + + diff --git a/addons/hr_timesheet/report/report_timesheet_templates.xml b/addons/hr_timesheet/report/report_timesheet_templates.xml new file mode 100644 index 00000000..1e74abae --- /dev/null +++ b/addons/hr_timesheet/report/report_timesheet_templates.xml @@ -0,0 +1,96 @@ + + + + + Timesheet Entries + account.analytic.line + qweb-pdf + hr_timesheet.report_timesheet + report_timesheet + + report + + -- cgit v1.2.3