Skip to content

Commit

Permalink
[MIG][15.0]hr_utilization_report:Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bizzappdev committed Mar 19, 2024
1 parent 3bc5495 commit 97c1b90
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 26 deletions.
2 changes: 1 addition & 1 deletion hr_utilization_report/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Task Logs Utilization Report
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0e6930e3625dcc77dd034b168f08a54d02c1134a1ec7bd3d2c430ac494fd9d8d
!! source digest: sha256:b4a5a465d48033e71533315bdb6ad12390720451691afe7dae8997edc695dcc2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion hr_utilization_report/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Task Logs Utilization Report",
"version": "14.0.1.0.1",
"version": "15.0.1.0.0",
"category": "Human Resources",
"website": "https://github.com/OCA/timesheet",
"author": "CorporateHub, " "Odoo Community Association (OCA)",
Expand Down
31 changes: 10 additions & 21 deletions hr_utilization_report/report/hr_utilization_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class HrUtilizationReport(models.TransientModel):
required=True,
)
only_active_employees = fields.Boolean(
string="Only Active Employees",
default=True,
)
employee_ids = fields.Many2many(
Expand Down Expand Up @@ -84,7 +83,6 @@ class HrUtilizationReport(models.TransientModel):
store=True,
)
total_capacity = fields.Float(
string="Total Capacity",
compute="_compute_total_capacity",
store=True,
)
Expand Down Expand Up @@ -292,7 +290,7 @@ def get_action(self, report_type="qweb-html"):
self.ensure_one()

if report_type not in self._supported_report_types():
raise UserError(_('"%s" report type is not supported' % (report_type)))
raise UserError(_('"%s" report type is not supported') % report_type)

Check warning on line 293 in hr_utilization_report/report/hr_utilization_report.py

View check run for this annotation

Codecov / codecov/patch

hr_utilization_report/report/hr_utilization_report.py#L293

Added line #L293 was not covered by tests

report_name = "hr_utilization_report.report"

Expand All @@ -306,11 +304,15 @@ def get_action(self, report_type="qweb-html"):
)
if not action:
raise UserError(

Check warning on line 306 in hr_utilization_report/report/hr_utilization_report.py

View check run for this annotation

Codecov / codecov/patch

hr_utilization_report/report/hr_utilization_report.py#L306

Added line #L306 was not covered by tests
_('"%s" report with "%s" type not found' % (report_name, report_type))
_('"%(report_name)s" report with "%(report_type)s" type not found')
% {
"report_name": report_name,
"report_type": report_type,
}
)

context = dict(self.env.context)
return action.with_context(context).report_action(self)
return action.with_context(**context).report_action(self)


class HrUtilizationReportAbstractField(models.AbstractModel):
Expand All @@ -325,7 +327,6 @@ class HrUtilizationReportAbstractField(models.AbstractModel):
ondelete="cascade",
)
sequence = fields.Integer(
string="Sequence",
required=True,
)
field_name = fields.Char(
Expand All @@ -337,14 +338,12 @@ class HrUtilizationReportAbstractField(models.AbstractModel):
required=True,
)
field_type = fields.Char(
string="Field type",
"Field type",
required=True,
)
aggregation = fields.Char(
string="Aggregation",
)
aggregation = fields.Char()
groupby = fields.Char(
string="Group-by expression",
"Group-by expression",
compute="_compute_groupby",
)

Expand Down Expand Up @@ -404,11 +403,9 @@ class HrUtilizationReportGroup(models.TransientModel):
ondelete="cascade",
)
sequence = fields.Integer(
string="Sequence",
required=True,
)
scope = fields.Char(
string="Scope",
required=True,
)
name = fields.Char()
Expand All @@ -425,7 +422,6 @@ class HrUtilizationReportGroup(models.TransientModel):
store=True,
)
total_capacity = fields.Float(
string="Total Capacity",
compute="_compute_total_capacity",
store=True,
)
Expand Down Expand Up @@ -516,11 +512,9 @@ class HrUtilizationReportBlock(models.TransientModel):
ondelete="cascade",
)
sequence = fields.Integer(
string="Sequence",
required=True,
)
employee_id = fields.Many2one(
string="Employee",
comodel_name="hr.employee",
required=True,
)
Expand All @@ -537,7 +531,6 @@ class HrUtilizationReportBlock(models.TransientModel):
store=True,
)
capacity = fields.Float(
string="Capacity",
compute="_compute_capacity",
store=True,
)
Expand Down Expand Up @@ -683,15 +676,12 @@ class HrUtilizationReportEntry(models.TransientModel):
ondelete="cascade",
)
sequence = fields.Integer(
string="Sequence",
required=True,
)
scope = fields.Char(
string="Scope",
required=True,
)
any_line_id = fields.Many2one(
string="Account Analytics Lines",
comodel_name="account.analytic.line",
compute="_compute_any_line_id",
)
Expand Down Expand Up @@ -815,7 +805,6 @@ def _emit_report(self, workbook, report, report_index):

group_row_indices = []
for group in report.group_ids:

if report.groupby_field_ids:
group_row_indices.append(rows_emitted)
rows_emitted += self._emit_group_header(
Expand Down
2 changes: 1 addition & 1 deletion hr_utilization_report/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Task Logs Utilization Report</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0e6930e3625dcc77dd034b168f08a54d02c1134a1ec7bd3d2c430ac494fd9d8d
!! source digest: sha256:b4a5a465d48033e71533315bdb6ad12390720451691afe7dae8997edc695dcc2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/timesheet/tree/15.0/hr_utilization_report"><img alt="OCA/timesheet" src="https://img.shields.io/badge/github-OCA%2Ftimesheet-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/timesheet-15-0/timesheet-15-0-hr_utilization_report"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/timesheet&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to generate Utilization Report from Task Logs.</p>
Expand Down
2 changes: 0 additions & 2 deletions hr_utilization_report/wizards/hr_utilization_report_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class HrUtilizationReportWizard(models.TransientModel):
required=True,
)
only_active_employees = fields.Boolean(
string="Only Active Employees",
default=True,
)
employee_ids = fields.Many2many(
Expand Down Expand Up @@ -194,7 +193,6 @@ class HrUtilizationReportWizardField(models.AbstractModel):
ondelete="cascade",
)
sequence = fields.Integer(
string="Sequence",
required=True,
default=10,
)
Expand Down

0 comments on commit 97c1b90

Please sign in to comment.