diff --git a/fieldservice_timesheet/README.rst b/fieldservice_timesheet/README.rst new file mode 100644 index 0000000000..0c858a2666 --- /dev/null +++ b/fieldservice_timesheet/README.rst @@ -0,0 +1,76 @@ +========================= +Field Service - Timesheet +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:18e662073811f53520b6f89a8c742dcde3367a50ebc075c172f9849c7ff9c833 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Ffield--service-lightgray.png?logo=github + :target: https://github.com/OCA/field-service/tree/17.0/fieldservice_timesheet + :alt: OCA/field-service +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/field-service-17-0/field-service-17-0-fieldservice_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/field-service&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Encode time spent on the different field service orders. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp + +Contributors +------------ + +- Vincent Van Rossem + +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. + +This module is part of the `OCA/field-service `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fieldservice_timesheet/__init__.py b/fieldservice_timesheet/__init__.py new file mode 100644 index 0000000000..bf588bc8b8 --- /dev/null +++ b/fieldservice_timesheet/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import report diff --git a/fieldservice_timesheet/__manifest__.py b/fieldservice_timesheet/__manifest__.py new file mode 100644 index 0000000000..1a21c2f80f --- /dev/null +++ b/fieldservice_timesheet/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2025 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Field Service - Timesheet", + "summary": "Timesheet on Field Service Orders", + "version": "17.0.1.0.0", + "license": "AGPL-3", + "author": "Camptocamp, Odoo Community Association (OCA)", + "category": "Project", + "website": "https://github.com/OCA/field-service", + "depends": [ + # odoo + "hr_timesheet", + # oca/field-service + "fieldservice_project", + ], + "data": [ + "views/fsm_order.xml", + "views/hr_timesheet.xml", + "report/report_timesheet_templates.xml", + ], + "installable": True, +} diff --git a/fieldservice_timesheet/i18n/fieldservice_timesheet.pot b/fieldservice_timesheet/i18n/fieldservice_timesheet.pot new file mode 100644 index 0000000000..aaa32b0d7e --- /dev/null +++ b/fieldservice_timesheet/i18n/fieldservice_timesheet.pot @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_timesheet +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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: fieldservice_timesheet +#: model:ir.model,name:fieldservice_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: fieldservice_timesheet +#: model_terms:ir.ui.view,arch_db:fieldservice_timesheet.hr_timesheet_line_search +msgid "FSM Order" +msgstr "" + +#. module: fieldservice_timesheet +#: model:ir.model,name:fieldservice_timesheet.model_fsm_order +#: model:ir.model.fields,field_description:fieldservice_timesheet.field_account_analytic_line__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_timesheet.field_timesheets_analysis_report__fsm_order_id +#: model_terms:ir.ui.view,arch_db:fieldservice_timesheet.timesheet_table +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_timesheet +#: model:ir.model.fields,field_description:fieldservice_timesheet.field_fsm_order__timesheet_ids +msgid "Timesheet" +msgstr "" + +#. module: fieldservice_timesheet +#: model_terms:ir.ui.view,arch_db:fieldservice_timesheet.view_fsm_order_project_form +msgid "Timesheets" +msgstr "" + +#. module: fieldservice_timesheet +#: model:ir.model,name:fieldservice_timesheet.model_timesheets_analysis_report +msgid "Timesheets Analysis Report" +msgstr "" diff --git a/fieldservice_timesheet/i18n/it.po b/fieldservice_timesheet/i18n/it.po new file mode 100644 index 0000000000..65279ec384 --- /dev/null +++ b/fieldservice_timesheet/i18n/it.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_timesheet +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-11-06 09:42+0000\n" +"Last-Translator: mymage \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 5.10.4\n" + +#. module: fieldservice_timesheet +#: model:ir.model,name:fieldservice_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "Riga analitica" + +#. module: fieldservice_timesheet +#: model_terms:ir.ui.view,arch_db:fieldservice_timesheet.hr_timesheet_line_search +msgid "FSM Order" +msgstr "Ordine FSM" + +#. module: fieldservice_timesheet +#: model:ir.model,name:fieldservice_timesheet.model_fsm_order +#: model:ir.model.fields,field_description:fieldservice_timesheet.field_account_analytic_line__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_timesheet.field_timesheets_analysis_report__fsm_order_id +#: model_terms:ir.ui.view,arch_db:fieldservice_timesheet.timesheet_table +msgid "Field Service Order" +msgstr "Ordine assistenza sul campo" + +#. module: fieldservice_timesheet +#: model:ir.model.fields,field_description:fieldservice_timesheet.field_fsm_order__timesheet_ids +msgid "Timesheet" +msgstr "Foglio ore" + +#. module: fieldservice_timesheet +#: model_terms:ir.ui.view,arch_db:fieldservice_timesheet.view_fsm_order_project_form +msgid "Timesheets" +msgstr "Fogli ore" + +#. module: fieldservice_timesheet +#: model:ir.model,name:fieldservice_timesheet.model_timesheets_analysis_report +msgid "Timesheets Analysis Report" +msgstr "Resoconto analisi fogli ore" diff --git a/fieldservice_timesheet/models/__init__.py b/fieldservice_timesheet/models/__init__.py new file mode 100644 index 0000000000..56a48cfca0 --- /dev/null +++ b/fieldservice_timesheet/models/__init__.py @@ -0,0 +1,2 @@ +from . import fsm_order +from . import hr_timesheet diff --git a/fieldservice_timesheet/models/fsm_order.py b/fieldservice_timesheet/models/fsm_order.py new file mode 100644 index 0000000000..c62df646e9 --- /dev/null +++ b/fieldservice_timesheet/models/fsm_order.py @@ -0,0 +1,14 @@ +# Copyright 2025 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class FSMOrder(models.Model): + _inherit = "fsm.order" + + timesheet_ids = fields.One2many( + comodel_name="account.analytic.line", + inverse_name="fsm_order_id", + string="Timesheet", + ) diff --git a/fieldservice_timesheet/models/hr_timesheet.py b/fieldservice_timesheet/models/hr_timesheet.py new file mode 100644 index 0000000000..ddef03d610 --- /dev/null +++ b/fieldservice_timesheet/models/hr_timesheet.py @@ -0,0 +1,14 @@ +# Copyright 2025 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountAnalyticLine(models.Model): + _inherit = "account.analytic.line" + + fsm_order_id = fields.Many2one( + comodel_name="fsm.order", + string="Field Service Order", + domain=[("project_id", "!=", False)], + ) diff --git a/fieldservice_timesheet/pyproject.toml b/fieldservice_timesheet/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/fieldservice_timesheet/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/fieldservice_timesheet/readme/CONTRIBUTORS.md b/fieldservice_timesheet/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..77f9a96dd2 --- /dev/null +++ b/fieldservice_timesheet/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Vincent Van Rossem \<\> diff --git a/fieldservice_timesheet/readme/DESCRIPTION.md b/fieldservice_timesheet/readme/DESCRIPTION.md new file mode 100644 index 0000000000..d172ff478c --- /dev/null +++ b/fieldservice_timesheet/readme/DESCRIPTION.md @@ -0,0 +1 @@ + Encode time spent on the different field service orders. diff --git a/fieldservice_timesheet/report/__init__.py b/fieldservice_timesheet/report/__init__.py new file mode 100644 index 0000000000..0cb32374b1 --- /dev/null +++ b/fieldservice_timesheet/report/__init__.py @@ -0,0 +1 @@ +from . import timesheets_analysis_report diff --git a/fieldservice_timesheet/report/report_timesheet_templates.xml b/fieldservice_timesheet/report/report_timesheet_templates.xml new file mode 100644 index 0000000000..afa0a13082 --- /dev/null +++ b/fieldservice_timesheet/report/report_timesheet_templates.xml @@ -0,0 +1,35 @@ + + + + + diff --git a/fieldservice_timesheet/report/timesheets_analysis_report.py b/fieldservice_timesheet/report/timesheets_analysis_report.py new file mode 100644 index 0000000000..0a5aca7ab3 --- /dev/null +++ b/fieldservice_timesheet/report/timesheets_analysis_report.py @@ -0,0 +1,21 @@ +# Copyright 2025 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class TimesheetsAnalysisReport(models.Model): + _inherit = "timesheets.analysis.report" + + fsm_order_id = fields.Many2one( + "fsm.order", string="Field Service Order", readonly=True + ) + + @api.model + def _select(self): + return ( + super()._select() + + """, + A.fsm_order_id AS fsm_order_id + """ + ) diff --git a/fieldservice_timesheet/static/description/icon.png b/fieldservice_timesheet/static/description/icon.png new file mode 100644 index 0000000000..1dcc49c24f Binary files /dev/null and b/fieldservice_timesheet/static/description/icon.png differ diff --git a/fieldservice_timesheet/static/description/index.html b/fieldservice_timesheet/static/description/index.html new file mode 100644 index 0000000000..a0979696a6 --- /dev/null +++ b/fieldservice_timesheet/static/description/index.html @@ -0,0 +1,423 @@ + + + + + +Field Service - Timesheet + + + +
+

Field Service - Timesheet

+ + +

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runboat

+

Encode time spent on the different field service orders.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

This module is part of the OCA/field-service project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/fieldservice_timesheet/views/fsm_order.xml b/fieldservice_timesheet/views/fsm_order.xml new file mode 100644 index 0000000000..7819b62a2b --- /dev/null +++ b/fieldservice_timesheet/views/fsm_order.xml @@ -0,0 +1,25 @@ + + + + fsm.order + + + + + + + + + + diff --git a/fieldservice_timesheet/views/hr_timesheet.xml b/fieldservice_timesheet/views/hr_timesheet.xml new file mode 100644 index 0000000000..cacb4d614a --- /dev/null +++ b/fieldservice_timesheet/views/hr_timesheet.xml @@ -0,0 +1,39 @@ + + + + account.analytic.line + + + + + + + + + + account.analytic.line + + + + + + + + + account.analytic.line + + + + + + + + + + +