Skip to content

Commit ca6a111

Browse files
committed
Merge PR #422 into 17.0
Signed-off-by pedrobaeza
2 parents 22096c2 + 2707b1a commit ca6a111

21 files changed

+1164
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
===================================
2+
Maintenance Timesheets Time Control
3+
===================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:999ce7cd27b56d7796c9594d15f4413473560b6e533bdd0fdcb842b877b2370d
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github
20+
:target: https://github.com/OCA/maintenance/tree/17.0/maintenance_timesheet_time_control
21+
:alt: OCA/maintenance
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/maintenance-17-0/maintenance-17-0-maintenance_timesheet_time_control
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/maintenance&target_branch=17.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
It allows to track the exact moment when a timesheet line is started
32+
(not only the day, but also the minute and second) and let users start
33+
and stop timers easily.
34+
35+
**Table of contents**
36+
37+
.. contents::
38+
:local:
39+
40+
Installation
41+
============
42+
43+
This module is auto-installed when ``maintenance_timesheet`` and
44+
``project_timesheet_time_control`` are installed.
45+
46+
This module depends on modules found in these repositories:
47+
48+
- `OCA/timesheet <https://github.com/OCA/timesheet>`__
49+
- `OCA/web <https://github.com/OCA/web>`__
50+
- `OCA/project <https://github.com/OCA/project>`__
51+
52+
Configuration
53+
=============
54+
55+
Maintenance request must have a project defined for seeing the
56+
start/stop buttons.
57+
58+
Usage
59+
=====
60+
61+
In general the usage instructions from
62+
``project_timesheet_time_control`` apply with the following additions.
63+
64+
Via maintenance requests:
65+
66+
1. Go to *Maintenance > Maintenance > Maintenance Requests*.
67+
2. If a request has a running timesheet line, it will display a *Stop*
68+
button.
69+
3. Other requests that have enabled timesheets will display a *Start*
70+
button that will open the same wizard as the timesheet lines,
71+
duplicating task's last timesheet line.
72+
4. You can see the same in list view.
73+
5. Click on any existing request or create a new one.
74+
6. You can see the same feature in the action buttons box.
75+
76+
Note: All the *Start/Resume/Stop* features are disabled if you don't
77+
belong to the *Timesheets/User* group or if you are viewing a timesheet
78+
that belongs to another user.
79+
80+
Bug Tracker
81+
===========
82+
83+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/maintenance/issues>`_.
84+
In case of trouble, please check there if your issue has already been reported.
85+
If you spotted it first, help us to smash it by providing a detailed and welcomed
86+
`feedback <https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_timesheet_time_control%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
87+
88+
Do not contact contributors directly about support or help with technical issues.
89+
90+
Credits
91+
=======
92+
93+
Authors
94+
-------
95+
96+
* Tecnativa
97+
98+
Contributors
99+
------------
100+
101+
- `Tecnativa <https://www.tecnativa.com>`__:
102+
103+
- Víctor Martínez
104+
- Pedro M. Baeza
105+
106+
Maintainers
107+
-----------
108+
109+
This module is maintained by the OCA.
110+
111+
.. image:: https://odoo-community.org/logo.png
112+
:alt: Odoo Community Association
113+
:target: https://odoo-community.org
114+
115+
OCA, or the Odoo Community Association, is a nonprofit organization whose
116+
mission is to support the collaborative development of Odoo features and
117+
promote its widespread use.
118+
119+
.. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px
120+
:target: https://github.com/victoralmau
121+
:alt: victoralmau
122+
123+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
124+
125+
|maintainer-victoralmau|
126+
127+
This module is part of the `OCA/maintenance <https://github.com/OCA/maintenance/tree/17.0/maintenance_timesheet_time_control>`_ project on GitHub.
128+
129+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import models
2+
from . import wizards
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2022 Tecnativa - Víctor Martínez
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Maintenance Timesheets Time Control",
6+
"summary": "Maintenance Timesheets Timesheet Time Control",
7+
"version": "17.0.1.0.0",
8+
"license": "AGPL-3",
9+
"category": "Hidden",
10+
"author": "Tecnativa,Odoo Community Association (OCA)",
11+
"website": "https://github.com/OCA/maintenance",
12+
"depends": ["maintenance_timesheet", "project_timesheet_time_control"],
13+
"data": ["views/maintenance_request_view.xml"],
14+
"auto_install": True,
15+
"maintainers": ["victoralmau"],
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * maintenance_timesheet_time_control
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 13.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2022-12-21 10:34+0000\n"
10+
"PO-Revision-Date: 2023-07-06 20:08+0000\n"
11+
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
12+
"Language-Team: \n"
13+
"Language: es\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
18+
"X-Generator: Weblate 4.17\n"
19+
20+
#. module: maintenance_timesheet_time_control
21+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form
22+
msgid "Date"
23+
msgstr "Fecha"
24+
25+
#. module: maintenance_timesheet_time_control
26+
#: model:ir.model,name:maintenance_timesheet_time_control.model_hr_timesheet_switch
27+
msgid "Helper to quickly switch between timesheet lines"
28+
msgstr "Ayudante para cambiar rápidamente de línea del parte de horas"
29+
30+
#. module: maintenance_timesheet_time_control
31+
#: model:ir.model.fields,help:maintenance_timesheet_time_control.field_maintenance_request__show_time_control
32+
msgid "Indicate which time control button to show, if any."
33+
msgstr "Indicar qué botón de control de tiempo se debe mostrar, si lo hay."
34+
35+
#. module: maintenance_timesheet_time_control
36+
#: model:ir.model,name:maintenance_timesheet_time_control.model_maintenance_request
37+
msgid "Maintenance Request"
38+
msgstr "Petición de mantenimiento"
39+
40+
#. module: maintenance_timesheet_time_control
41+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form
42+
msgid "Resume work"
43+
msgstr "Resumen del trabajo"
44+
45+
#. module: maintenance_timesheet_time_control
46+
#: model:ir.model.fields,field_description:maintenance_timesheet_time_control.field_maintenance_request__show_time_control
47+
msgid "Show Time Control"
48+
msgstr "Mostrar control de tiempo"
49+
50+
#. module: maintenance_timesheet_time_control
51+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form
52+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban
53+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree
54+
msgid "Start work"
55+
msgstr "Iniciar trabajo"
56+
57+
#. module: maintenance_timesheet_time_control
58+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form
59+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form
60+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban
61+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree
62+
msgid "Stop work"
63+
msgstr "Detener trabajo"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * maintenance_timesheet_time_control
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 15.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2023-10-10 16:37+0000\n"
10+
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
11+
"Language-Team: none\n"
12+
"Language: it\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 4.17\n"
18+
19+
#. module: maintenance_timesheet_time_control
20+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form
21+
msgid "Date"
22+
msgstr "Data"
23+
24+
#. module: maintenance_timesheet_time_control
25+
#: model:ir.model,name:maintenance_timesheet_time_control.model_hr_timesheet_switch
26+
msgid "Helper to quickly switch between timesheet lines"
27+
msgstr "Assistente per spostarsi velocemente tra righe del foglio ore"
28+
29+
#. module: maintenance_timesheet_time_control
30+
#: model:ir.model.fields,help:maintenance_timesheet_time_control.field_maintenance_request__show_time_control
31+
msgid "Indicate which time control button to show, if any."
32+
msgstr "Indica se e quale pulsante di controllo tempo visualizzare."
33+
34+
#. module: maintenance_timesheet_time_control
35+
#: model:ir.model,name:maintenance_timesheet_time_control.model_maintenance_request
36+
msgid "Maintenance Request"
37+
msgstr "Richiesta di manutenzione"
38+
39+
#. module: maintenance_timesheet_time_control
40+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form
41+
msgid "Resume work"
42+
msgstr "Riprendi lavoro"
43+
44+
#. module: maintenance_timesheet_time_control
45+
#: model:ir.model.fields,field_description:maintenance_timesheet_time_control.field_maintenance_request__show_time_control
46+
msgid "Show Time Control"
47+
msgstr "Visualizza controllo orario"
48+
49+
#. module: maintenance_timesheet_time_control
50+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form
51+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban
52+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree
53+
msgid "Start work"
54+
msgstr "Avvia lavoro"
55+
56+
#. module: maintenance_timesheet_time_control
57+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form
58+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form
59+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban
60+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree
61+
msgid "Stop work"
62+
msgstr "Ferma lavoro"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * maintenance_timesheet_time_control
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: maintenance_timesheet_time_control
17+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form
18+
msgid "Date"
19+
msgstr ""
20+
21+
#. module: maintenance_timesheet_time_control
22+
#: model:ir.model,name:maintenance_timesheet_time_control.model_hr_timesheet_switch
23+
msgid "Helper to quickly switch between timesheet lines"
24+
msgstr ""
25+
26+
#. module: maintenance_timesheet_time_control
27+
#: model:ir.model.fields,help:maintenance_timesheet_time_control.field_maintenance_request__show_time_control
28+
msgid "Indicate which time control button to show, if any."
29+
msgstr ""
30+
31+
#. module: maintenance_timesheet_time_control
32+
#: model:ir.model,name:maintenance_timesheet_time_control.model_maintenance_request
33+
msgid "Maintenance Request"
34+
msgstr ""
35+
36+
#. module: maintenance_timesheet_time_control
37+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form
38+
msgid "Resume work"
39+
msgstr ""
40+
41+
#. module: maintenance_timesheet_time_control
42+
#: model:ir.model.fields,field_description:maintenance_timesheet_time_control.field_maintenance_request__show_time_control
43+
msgid "Show Time Control"
44+
msgstr ""
45+
46+
#. module: maintenance_timesheet_time_control
47+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form
48+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban
49+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree
50+
msgid "Start work"
51+
msgstr ""
52+
53+
#. module: maintenance_timesheet_time_control
54+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form
55+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form
56+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban
57+
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree
58+
msgid "Stop work"
59+
msgstr ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import maintenance_request
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2022 Tecnativa - Víctor Martínez
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, models
5+
6+
7+
class MaintenanceRequest(models.Model):
8+
_name = "maintenance.request"
9+
_inherit = ["maintenance.request", "hr.timesheet.time_control.mixin"]
10+
11+
@api.model
12+
def _relation_with_timesheet_line(self):
13+
return "maintenance_request_id"
14+
15+
@api.depends(
16+
"project_id.allow_timesheets",
17+
"timesheet_ids.employee_id",
18+
"timesheet_ids.unit_amount",
19+
)
20+
def _compute_show_time_control(self):
21+
result = super()._compute_show_time_control()
22+
for item in self.filtered(lambda x: not x.project_id.allow_timesheets):
23+
item.show_time_control = False
24+
return result
25+
26+
def button_start_work(self):
27+
result = super().button_start_work()
28+
result["context"].update(
29+
{
30+
"default_project_id": self.project_id.id,
31+
"default_task_id": self.task_id.id,
32+
}
33+
)
34+
return result
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Maintenance request must have a project defined for seeing the
2+
start/stop buttons.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [Tecnativa](https://www.tecnativa.com):
2+
- Víctor Martínez
3+
- Pedro M. Baeza
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
It allows to track the exact moment when a timesheet line is started
2+
(not only the day, but also the minute and second) and let users start
3+
and stop timers easily.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This module is auto-installed when `maintenance_timesheet` and
2+
`project_timesheet_time_control` are installed.
3+
4+
This module depends on modules found in these repositories:
5+
6+
- [OCA/timesheet](https://github.com/OCA/timesheet)
7+
- [OCA/web](https://github.com/OCA/web)
8+
- [OCA/project](https://github.com/OCA/project)

0 commit comments

Comments
 (0)