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][ADD] repair_timesheet: New module repair_timesheet #62

Merged
merged 1 commit into from
Oct 28, 2024
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
101 changes: 101 additions & 0 deletions repair_timesheet/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
================
Repair Timesheet
================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c2e64dc6606c845bb75e06ed854b15fc84a222c2d97408272e22e530092f5b86
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Frepair-lightgray.png?logo=github
:target: https://github.com/OCA/repair/tree/17.0/repair_timesheet
:alt: OCA/repair
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/repair-17-0/repair-17-0-repair_timesheet
: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/repair&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module integrates timesheet tracking with repair orders. It adds a
"Timesheets" tab to the repair order form, allowing users to log and
track the time spent on each repair through timesheet entries. Users can
record detailed timesheet data, such as the project, task, date, and
duration for each repair. Additionally, the module automatically
calculates the total hours spent on repairs and displays this
information in both the form view and the list view of repair orders.

**Table of contents**

.. contents::
:local:

Usage
=====

When creating or editing a repair order, you will find a new Timesheets
tab within the repair order form. In this tab, you can log and track the
time spent on the repair by adding timesheet entries. Each entry allows
you to specify the project, task, date, and the time spent on the repair
in hours and minutes.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/repair/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/repair/issues/new?body=module:%20repair_timesheet%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
-------

* APSL-Nagarro

Contributors
------------

- `APSL-Nagarro <https://apsl.tech>`__:

- Patryk Pyczko <[email protected]>

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-ppyczko| image:: https://github.com/ppyczko.png?size=40px
:target: https://github.com/ppyczko
:alt: ppyczko

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ppyczko|

This module is part of the `OCA/repair <https://github.com/OCA/repair/tree/17.0/repair_timesheet>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions repair_timesheet/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
16 changes: 16 additions & 0 deletions repair_timesheet/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Patryk Pyczko (APSL-Nagarro)<[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Repair Timesheet",
"version": "17.0.1.0.0",
"category": "Repair",
"website": "https://github.com/OCA/repair",
"author": "APSL-Nagarro, Odoo Community Association (OCA)",
"maintainers": ["ppyczko"],
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["repair", "hr_timesheet"],
"data": ["views/repair_views.xml"],
}
57 changes: 57 additions & 0 deletions repair_timesheet/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_timesheet
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-16 08:59+0000\n"
"PO-Revision-Date: 2024-10-16 08:59+0000\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: repair_timesheet
#: model:ir.model,name:repair_timesheet.model_account_analytic_line
msgid "Analytic Line"
msgstr "Línia analítica"

#. module: repair_timesheet
#: model_terms:ir.ui.view,arch_db:repair_timesheet.repair_order_form_view_timesheet_inherit
msgid "Duration (Hour(s))"
msgstr "Durada (Hora/es)"

#. module: repair_timesheet
#: model:ir.model.fields,field_description:repair_timesheet.field_account_analytic_line__repair_order_id
msgid "Related Repair Order"
msgstr "Ordre de reparació relacionada"

#. module: repair_timesheet
#: model:ir.model,name:repair_timesheet.model_repair_order
msgid "Repair Order"
msgstr "Ordre de reparació"

#. module: repair_timesheet
#: model:ir.model.fields,help:repair_timesheet.field_account_analytic_line__repair_order_id
msgid "The repair order related to this timesheet entry."
msgstr "L'ordre de reparació relacionada amb aquesta entrada de full d'hores."

#. module: repair_timesheet
#: model:ir.model.fields,field_description:repair_timesheet.field_repair_order__timesheet_ids
#: model_terms:ir.ui.view,arch_db:repair_timesheet.repair_order_form_view_timesheet_inherit
msgid "Timesheets"
msgstr "Fulls d'hores"

#. module: repair_timesheet
#: model:ir.model.fields,field_description:repair_timesheet.field_repair_order__timesheet_total_hours
msgid "Total Hours"
msgstr "Hores totals"

#. module: repair_timesheet
#: model:ir.model.fields,help:repair_timesheet.field_repair_order__timesheet_total_hours
msgid "Total hours spent on this repair order."
msgstr "Hores totals dedicades a aquesta ordre de reparació."
57 changes: 57 additions & 0 deletions repair_timesheet/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_timesheet
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-16 09:00+0000\n"
"PO-Revision-Date: 2024-10-16 09:00+0000\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: repair_timesheet
#: model:ir.model,name:repair_timesheet.model_account_analytic_line
msgid "Analytic Line"
msgstr "Línea analítica"

#. module: repair_timesheet
#: model_terms:ir.ui.view,arch_db:repair_timesheet.repair_order_form_view_timesheet_inherit
msgid "Duration (Hour(s))"
msgstr "Duración (Hora/s)"

#. module: repair_timesheet
#: model:ir.model.fields,field_description:repair_timesheet.field_account_analytic_line__repair_order_id
msgid "Related Repair Order"
msgstr "Orden de reparación relacionada"

#. module: repair_timesheet
#: model:ir.model,name:repair_timesheet.model_repair_order
msgid "Repair Order"
msgstr "Orden de reparación"

#. module: repair_timesheet
#: model:ir.model.fields,help:repair_timesheet.field_account_analytic_line__repair_order_id
msgid "The repair order related to this timesheet entry."
msgstr "La orden de reparación relacionada con esta entrada de parte de horas."

#. module: repair_timesheet
#: model:ir.model.fields,field_description:repair_timesheet.field_repair_order__timesheet_ids
#: model_terms:ir.ui.view,arch_db:repair_timesheet.repair_order_form_view_timesheet_inherit
msgid "Timesheets"
msgstr "Partes de horas"

#. module: repair_timesheet
#: model:ir.model.fields,field_description:repair_timesheet.field_repair_order__timesheet_total_hours
msgid "Total Hours"
msgstr "Horas totales"

#. module: repair_timesheet
#: model:ir.model.fields,help:repair_timesheet.field_repair_order__timesheet_total_hours
msgid "Total hours spent on this repair order."
msgstr "Horas totales dedicadas a esta orden de reparación."
4 changes: 4 additions & 0 deletions repair_timesheet/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import repair
from . import hr_timesheet
14 changes: 14 additions & 0 deletions repair_timesheet/models/hr_timesheet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Patryk Pyczko (APSL-Nagarro)<[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class AccountAnalyticLine(models.Model):
_inherit = "account.analytic.line"

repair_order_id = fields.Many2one(
"repair.order",
string="Related Repair Order",
help="The repair order related to this timesheet entry.",
)
23 changes: 23 additions & 0 deletions repair_timesheet/models/repair.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Patryk Pyczko (APSL-Nagarro)<[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class RepairOrder(models.Model):
_inherit = "repair.order"

timesheet_ids = fields.One2many(
"account.analytic.line", "repair_order_id", string="Timesheets"
)
timesheet_total_hours = fields.Float(
string="Total Hours",
compute="_compute_timesheet_total_hours",
store=True,
help="Total hours spent on this repair order.",
)

@api.depends("timesheet_ids.unit_amount")
def _compute_timesheet_total_hours(self):
for order in self:
order.timesheet_total_hours = sum(order.timesheet_ids.mapped("unit_amount"))
3 changes: 3 additions & 0 deletions repair_timesheet/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions repair_timesheet/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [APSL-Nagarro](https://apsl.tech):

> - Patryk Pyczko \<<[email protected]>\>
1 change: 1 addition & 0 deletions repair_timesheet/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module integrates timesheet tracking with repair orders. It adds a "Timesheets" tab to the repair order form, allowing users to log and track the time spent on each repair through timesheet entries. Users can record detailed timesheet data, such as the project, task, date, and duration for each repair. Additionally, the module automatically calculates the total hours spent on repairs and displays this information in both the form view and the list view of repair orders.
1 change: 1 addition & 0 deletions repair_timesheet/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When creating or editing a repair order, you will find a new Timesheets tab within the repair order form. In this tab, you can log and track the time spent on the repair by adding timesheet entries. Each entry allows you to specify the project, task, date, and the time spent on the repair in hours and minutes.
Binary file added repair_timesheet/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading