-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
21 changed files
with
1,164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
=================================== | ||
Maintenance Timesheets Time Control | ||
=================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:999ce7cd27b56d7796c9594d15f4413473560b6e533bdd0fdcb842b877b2370d | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
: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/17.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-17-0/maintenance-17-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=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
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. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Installation | ||
============ | ||
|
||
This module is auto-installed when ``maintenance_timesheet`` and | ||
``project_timesheet_time_control`` are installed. | ||
|
||
This module depends on modules found in these repositories: | ||
|
||
- `OCA/timesheet <https://github.com/OCA/timesheet>`__ | ||
- `OCA/web <https://github.com/OCA/web>`__ | ||
- `OCA/project <https://github.com/OCA/project>`__ | ||
|
||
Configuration | ||
============= | ||
|
||
Maintenance request must have a project defined for seeing the | ||
start/stop buttons. | ||
|
||
Usage | ||
===== | ||
|
||
In general the usage instructions from | ||
``project_timesheet_time_control`` apply with the following additions. | ||
|
||
Via maintenance requests: | ||
|
||
1. Go to *Maintenance > Maintenance > Maintenance Requests*. | ||
2. If a request has a running timesheet line, it will display a *Stop* | ||
button. | ||
3. Other requests that have enabled timesheets will display a *Start* | ||
button that will open the same wizard as the timesheet lines, | ||
duplicating task's last timesheet line. | ||
4. You can see the same in list view. | ||
5. Click on any existing request or create a new one. | ||
6. You can see the same feature in the action buttons box. | ||
|
||
Note: All the *Start/Resume/Stop* features are disabled if you don't | ||
belong to the *Timesheets/User* group or if you are viewing a timesheet | ||
that belongs to another user. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/maintenance/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 <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**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* Tecnativa | ||
|
||
Contributors | ||
------------ | ||
|
||
- `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
- Víctor Martínez | ||
- Pedro M. Baeza | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
.. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px | ||
:target: https://github.com/victoralmau | ||
:alt: victoralmau | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-victoralmau| | ||
|
||
This module is part of the `OCA/maintenance <https://github.com/OCA/maintenance/tree/17.0/maintenance_timesheet_time_control>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import models | ||
from . import wizards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2022 Tecnativa - Víctor Martínez | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Maintenance Timesheets Time Control", | ||
"summary": "Maintenance Timesheets Timesheet Time Control", | ||
"version": "17.0.1.0.0", | ||
"license": "AGPL-3", | ||
"category": "Hidden", | ||
"author": "Tecnativa,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/maintenance", | ||
"depends": ["maintenance_timesheet", "project_timesheet_time_control"], | ||
"data": ["views/maintenance_request_view.xml"], | ||
"auto_install": True, | ||
"maintainers": ["victoralmau"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * maintenance_timesheet_time_control | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2022-12-21 10:34+0000\n" | ||
"PO-Revision-Date: 2023-07-06 20:08+0000\n" | ||
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n" | ||
"Language-Team: \n" | ||
"Language: es\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form | ||
msgid "Date" | ||
msgstr "Fecha" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model,name:maintenance_timesheet_time_control.model_hr_timesheet_switch | ||
msgid "Helper to quickly switch between timesheet lines" | ||
msgstr "Ayudante para cambiar rápidamente de línea del parte de horas" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model.fields,help:maintenance_timesheet_time_control.field_maintenance_request__show_time_control | ||
msgid "Indicate which time control button to show, if any." | ||
msgstr "Indicar qué botón de control de tiempo se debe mostrar, si lo hay." | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model,name:maintenance_timesheet_time_control.model_maintenance_request | ||
msgid "Maintenance Request" | ||
msgstr "Petición de mantenimiento" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form | ||
msgid "Resume work" | ||
msgstr "Resumen del trabajo" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model.fields,field_description:maintenance_timesheet_time_control.field_maintenance_request__show_time_control | ||
msgid "Show Time Control" | ||
msgstr "Mostrar control de tiempo" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree | ||
msgid "Start work" | ||
msgstr "Iniciar trabajo" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree | ||
msgid "Stop work" | ||
msgstr "Detener trabajo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * maintenance_timesheet_time_control | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-10-10 16:37+0000\n" | ||
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n" | ||
"Language-Team: none\n" | ||
"Language: it\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form | ||
msgid "Date" | ||
msgstr "Data" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model,name:maintenance_timesheet_time_control.model_hr_timesheet_switch | ||
msgid "Helper to quickly switch between timesheet lines" | ||
msgstr "Assistente per spostarsi velocemente tra righe del foglio ore" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model.fields,help:maintenance_timesheet_time_control.field_maintenance_request__show_time_control | ||
msgid "Indicate which time control button to show, if any." | ||
msgstr "Indica se e quale pulsante di controllo tempo visualizzare." | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model,name:maintenance_timesheet_time_control.model_maintenance_request | ||
msgid "Maintenance Request" | ||
msgstr "Richiesta di manutenzione" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form | ||
msgid "Resume work" | ||
msgstr "Riprendi lavoro" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model.fields,field_description:maintenance_timesheet_time_control.field_maintenance_request__show_time_control | ||
msgid "Show Time Control" | ||
msgstr "Visualizza controllo orario" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree | ||
msgid "Start work" | ||
msgstr "Avvia lavoro" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree | ||
msgid "Stop work" | ||
msgstr "Ferma lavoro" |
59 changes: 59 additions & 0 deletions
59
maintenance_timesheet_time_control/i18n/maintenance_timesheet_time_control.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * maintenance_timesheet_time_control | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form | ||
msgid "Date" | ||
msgstr "" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model,name:maintenance_timesheet_time_control.model_hr_timesheet_switch | ||
msgid "Helper to quickly switch between timesheet lines" | ||
msgstr "" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model.fields,help:maintenance_timesheet_time_control.field_maintenance_request__show_time_control | ||
msgid "Indicate which time control button to show, if any." | ||
msgstr "" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model,name:maintenance_timesheet_time_control.model_maintenance_request | ||
msgid "Maintenance Request" | ||
msgstr "" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form | ||
msgid "Resume work" | ||
msgstr "" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model:ir.model.fields,field_description:maintenance_timesheet_time_control.field_maintenance_request__show_time_control | ||
msgid "Show Time Control" | ||
msgstr "" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree | ||
msgid "Start work" | ||
msgstr "" | ||
|
||
#. module: maintenance_timesheet_time_control | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.equipment_request_view_form | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_form | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_kanban | ||
#: model_terms:ir.ui.view,arch_db:maintenance_timesheet_time_control.hr_equipment_request_view_tree | ||
msgid "Stop work" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import maintenance_request |
34 changes: 34 additions & 0 deletions
34
maintenance_timesheet_time_control/models/maintenance_request.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright 2022 Tecnativa - Víctor Martínez | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class MaintenanceRequest(models.Model): | ||
_name = "maintenance.request" | ||
_inherit = ["maintenance.request", "hr.timesheet.time_control.mixin"] | ||
|
||
@api.model | ||
def _relation_with_timesheet_line(self): | ||
return "maintenance_request_id" | ||
|
||
@api.depends( | ||
"project_id.allow_timesheets", | ||
"timesheet_ids.employee_id", | ||
"timesheet_ids.unit_amount", | ||
) | ||
def _compute_show_time_control(self): | ||
result = super()._compute_show_time_control() | ||
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): | ||
result = super().button_start_work() | ||
result["context"].update( | ||
{ | ||
"default_project_id": self.project_id.id, | ||
"default_task_id": self.task_id.id, | ||
} | ||
) | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Maintenance request must have a project defined for seeing the | ||
start/stop buttons. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- [Tecnativa](https://www.tecnativa.com): | ||
- Víctor Martínez | ||
- Pedro M. Baeza |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
This module is auto-installed when `maintenance_timesheet` and | ||
`project_timesheet_time_control` are installed. | ||
|
||
This module depends on modules found in these repositories: | ||
|
||
- [OCA/timesheet](https://github.com/OCA/timesheet) | ||
- [OCA/web](https://github.com/OCA/web) | ||
- [OCA/project](https://github.com/OCA/project) |
Oops, something went wrong.