Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] maintenance_timesheet_time_control: Migration to 17.0 #422

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions maintenance_timesheet_time_control/README.rst
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.
2 changes: 2 additions & 0 deletions maintenance_timesheet_time_control/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
16 changes: 16 additions & 0 deletions maintenance_timesheet_time_control/__manifest__.py
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"],
}
63 changes: 63 additions & 0 deletions maintenance_timesheet_time_control/i18n/es.po
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"
62 changes: 62 additions & 0 deletions maintenance_timesheet_time_control/i18n/it.po
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"
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 ""
1 change: 1 addition & 0 deletions maintenance_timesheet_time_control/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import maintenance_request
34 changes: 34 additions & 0 deletions maintenance_timesheet_time_control/models/maintenance_request.py
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

Check warning on line 23 in maintenance_timesheet_time_control/models/maintenance_request.py

View check run for this annotation

Codecov / codecov/patch

maintenance_timesheet_time_control/models/maintenance_request.py#L23

Added line #L23 was not covered by tests
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
3 changes: 3 additions & 0 deletions maintenance_timesheet_time_control/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions maintenance_timesheet_time_control/readme/CONFIGURE.md
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.
3 changes: 3 additions & 0 deletions maintenance_timesheet_time_control/readme/CONTRIBUTORS.md
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
3 changes: 3 additions & 0 deletions maintenance_timesheet_time_control/readme/DESCRIPTION.md
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.
8 changes: 8 additions & 0 deletions maintenance_timesheet_time_control/readme/INSTALL.md
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)
Loading
Loading