Skip to content

Commit

Permalink
[ADD] maintenance_timesheet_time_control: New module
Browse files Browse the repository at this point in the history
TT40881

[UPD] Update maintenance_timesheet_time_control.pot

[UPD] README.rst
  • Loading branch information
victoralmau committed Mar 5, 2024
1 parent c99eea3 commit 609ae7b
Show file tree
Hide file tree
Showing 18 changed files with 983 additions and 0 deletions.
118 changes: 118 additions & 0 deletions maintenance_timesheet_time_control/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
===================================
Maintenance Timesheets Time Control
===================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/13.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-13-0/maintenance-13-0-maintenance_timesheet_time_control
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/240/13.0
:alt: Try me on Runbot

|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>`__

Usage
=====

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

Via maintenance requests:

#. Go to *Maintenance > Maintenance > Maintenance Requests*.
#. If a request has a running timesheet line, it will display a *Stop* button.
#. 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.
#. You can see the same in list view.
#. Click on any existing request or create a new one.
#. 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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_timesheet_time_control%0Aversion:%2013.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/13.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": "13.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"],
}
42 changes: 42 additions & 0 deletions maintenance_timesheet_time_control/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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: 2022-12-21 11:34+0100\n"
"Last-Translator: \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: \n"
"X-Generator: Poedit 3.0.1\n"

#. 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,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.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.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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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"
"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: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,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.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.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
35 changes: 35 additions & 0 deletions maintenance_timesheet_time_control/models/maintenance_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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()
self.filtered(lambda x: not x.project_id.allow_timesheets).update(
{"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
4 changes: 4 additions & 0 deletions maintenance_timesheet_time_control/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza
3 changes: 3 additions & 0 deletions maintenance_timesheet_time_control/readme/DESCRIPTION.rst
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.rst
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>`__
16 changes: 16 additions & 0 deletions maintenance_timesheet_time_control/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
In general the usage instructions from ``project_timesheet_time_control`` apply with the following additions.

Via maintenance requests:

#. Go to *Maintenance > Maintenance > Maintenance Requests*.
#. If a request has a running timesheet line, it will display a *Stop* button.
#. 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.
#. You can see the same in list view.
#. Click on any existing request or create a new one.
#. 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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 609ae7b

Please sign in to comment.