diff --git a/maintenance_timesheet_time_control/README.rst b/maintenance_timesheet_time_control/README.rst index 2b7fffabc..2de4bea19 100644 --- a/maintenance_timesheet_time_control/README.rst +++ b/maintenance_timesheet_time_control/README.rst @@ -7,7 +7,7 @@ Maintenance Timesheets Time Control !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:f87f5fb20528f45f783949d8c35ae4bf7da709b0eb88e4a84af270582ddf93e2 + !! source digest: sha256:999ce7cd27b56d7796c9594d15f4413473560b6e533bdd0fdcb842b877b2370d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -17,13 +17,13 @@ Maintenance Timesheets Time Control :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github - :target: https://github.com/OCA/maintenance/tree/15.0/maintenance_timesheet_time_control + :target: https://github.com/OCA/maintenance/tree/16.0/maintenance_timesheet_time_control :alt: OCA/maintenance .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/maintenance-15-0/maintenance-15-0-maintenance_timesheet_time_control + :target: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_timesheet_time_control :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/maintenance&target_branch=15.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/maintenance&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -49,6 +49,11 @@ This module depends on modules found in these repositories: * `OCA/web `__ * `OCA/project `__ +Configuration +============= + +Maintenance request must have a project defined for seeing the start/stop buttons. + Usage ===== @@ -75,7 +80,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -116,6 +121,6 @@ Current `maintainer `__: |maintainer-victoralmau| -This module is part of the `OCA/maintenance `_ project on GitHub. +This module is part of the `OCA/maintenance `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/maintenance_timesheet_time_control/__manifest__.py b/maintenance_timesheet_time_control/__manifest__.py index 68f6e17b5..a8d0195db 100644 --- a/maintenance_timesheet_time_control/__manifest__.py +++ b/maintenance_timesheet_time_control/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Maintenance Timesheets Time Control", "summary": "Maintenance Timesheets Timesheet Time Control", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "license": "AGPL-3", "category": "Hidden", "author": "Tecnativa,Odoo Community Association (OCA)", diff --git a/maintenance_timesheet_time_control/models/maintenance_request.py b/maintenance_timesheet_time_control/models/maintenance_request.py index 25f698e1e..cf5e70b2a 100644 --- a/maintenance_timesheet_time_control/models/maintenance_request.py +++ b/maintenance_timesheet_time_control/models/maintenance_request.py @@ -19,9 +19,8 @@ def _relation_with_timesheet_line(self): ) def _compute_show_time_control(self): result = super()._compute_show_time_control() - self.filtered(lambda x: not x.project_id.allow_timesheets).update( - {"show_time_control": False} - ) + for item in self.filtered(lambda x: not x.project_id.allow_timesheets): + item.show_time_control = False return result def button_start_work(self): diff --git a/maintenance_timesheet_time_control/readme/CONFIGURE.rst b/maintenance_timesheet_time_control/readme/CONFIGURE.rst new file mode 100644 index 000000000..d3fda1611 --- /dev/null +++ b/maintenance_timesheet_time_control/readme/CONFIGURE.rst @@ -0,0 +1 @@ +Maintenance request must have a project defined for seeing the start/stop buttons. diff --git a/maintenance_timesheet_time_control/static/description/index.html b/maintenance_timesheet_time_control/static/description/index.html index 122f72788..e8c03184c 100644 --- a/maintenance_timesheet_time_control/static/description/index.html +++ b/maintenance_timesheet_time_control/static/description/index.html @@ -367,9 +367,9 @@

Maintenance Timesheets Time Control

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:f87f5fb20528f45f783949d8c35ae4bf7da709b0eb88e4a84af270582ddf93e2 +!! source digest: sha256:999ce7cd27b56d7796c9594d15f4413473560b6e533bdd0fdcb842b877b2370d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/maintenance Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/maintenance Translate me on Weblate Try me on Runboat

It allows to track the exact moment when a timesheet line is started (not only the day, but also the minute and second) and let users start and stop timers easily.

@@ -377,12 +377,13 @@

Maintenance Timesheets Time Control

+
+

Configuration

+

Maintenance request must have a project defined for seeing the start/stop buttons.

+
-

Usage

+

Usage

In general the usage instructions from project_timesheet_time_control apply with the following additions.

Via maintenance requests:

    @@ -417,23 +422,23 @@

    Usage

    to another user.

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose @@ -451,7 +456,7 @@

Maintainers

promote its widespread use.

Current maintainer:

victoralmau

-

This module is part of the OCA/maintenance project on GitHub.

+

This module is part of the OCA/maintenance project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/maintenance_timesheet_time_control/tests/test_maintenance_timesheet_time_control.py b/maintenance_timesheet_time_control/tests/test_maintenance_timesheet_time_control.py index 883f23130..bae326363 100644 --- a/maintenance_timesheet_time_control/tests/test_maintenance_timesheet_time_control.py +++ b/maintenance_timesheet_time_control/tests/test_maintenance_timesheet_time_control.py @@ -1,44 +1,38 @@ -# Copyright 2022-2023 Tecnativa - Víctor Martínez +# Copyright 2022-2024 Tecnativa - Víctor Martínez # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 from datetime import datetime, timedelta from odoo import exceptions -from odoo.tests import common, new_test_user, users +from odoo.tests import new_test_user, users +from odoo.addons.base.tests.common import BaseCommon -class TestMaintenanceTimesheetTimeControl(common.TransactionCase): + +class TestMaintenanceTimesheetTimeControl(BaseCommon): @classmethod def setUpClass(cls): super().setUpClass() - ctx = { - "mail_create_nolog": True, - "mail_create_nosubscribe": True, - "mail_notrack": True, - "no_reset_password": True, - } - maintenance_group = "maintenance.group_equipment_manager" - timesheet_group = "hr_timesheet.group_hr_timesheet_user" cls.user = new_test_user( cls.env, login="test-maintenance-user", - groups="%s,%s" % (maintenance_group, timesheet_group), - context=ctx, - ) - cls.employee = cls.env["hr.employee"].create( - {"name": "Test employee", "user_id": cls.user.id} + groups="maintenance.group_equipment_manager," + "hr_timesheet.group_hr_timesheet_user", ) + cls.user.action_create_employee() cls.project = cls.env["project.project"].create( {"name": "Test project", "allow_timesheets": True} ) + cls.category = cls.env["maintenance.equipment.category"].create( + {"name": "Test category"} + ) + cls.team = cls.env["maintenance.team"].create({"name": "Test team"}) cls.equipment = cls.env["maintenance.equipment"].create( { "name": "Test computer", - "category_id": cls.env.ref("maintenance.equipment_computer").id, + "category_id": cls.category.id, "project_id": cls.project.id, - "maintenance_team_id": cls.env.ref( - "maintenance.equipment_team_maintenance" - ).id, + "maintenance_team_id": cls.team.id, } ) diff --git a/maintenance_timesheet_time_control/views/maintenance_request_view.xml b/maintenance_timesheet_time_control/views/maintenance_request_view.xml index f73dd0289..977e2a2a7 100644 --- a/maintenance_timesheet_time_control/views/maintenance_request_view.xml +++ b/maintenance_timesheet_time_control/views/maintenance_request_view.xml @@ -9,13 +9,13 @@ name="inherit_id" ref="maintenance_timesheet.hr_equipment_request_view_form" /> -
- +
@@ -44,10 +46,6 @@ name="inherit_id" ref="maintenance_timesheet.equipment_request_view_form" /> - - +