Skip to content
Open
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
76 changes: 76 additions & 0 deletions fieldservice_timesheet/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/field-service/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/field-service/issues/new?body=module:%20fieldservice_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
-------

* Camptocamp

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

- Vincent Van Rossem <vincent.vanrossem@camptocamp.com>

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 <https://github.com/OCA/field-service/tree/17.0/fieldservice_timesheet>`_ 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 fieldservice_timesheet/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import report
23 changes: 23 additions & 0 deletions fieldservice_timesheet/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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,
}
47 changes: 47 additions & 0 deletions fieldservice_timesheet/i18n/fieldservice_timesheet.pot
Original file line number Diff line number Diff line change
@@ -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 ""
50 changes: 50 additions & 0 deletions fieldservice_timesheet/i18n/it.po
Original file line number Diff line number Diff line change
@@ -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 <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 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"
2 changes: 2 additions & 0 deletions fieldservice_timesheet/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import fsm_order
from . import hr_timesheet
14 changes: 14 additions & 0 deletions fieldservice_timesheet/models/fsm_order.py
Original file line number Diff line number Diff line change
@@ -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",
)
14 changes: 14 additions & 0 deletions fieldservice_timesheet/models/hr_timesheet.py
Original file line number Diff line number Diff line change
@@ -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)],
)
3 changes: 3 additions & 0 deletions fieldservice_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"
1 change: 1 addition & 0 deletions fieldservice_timesheet/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Vincent Van Rossem \<<vincent.vanrossem@camptocamp.com>\>
1 change: 1 addition & 0 deletions fieldservice_timesheet/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Encode time spent on the different field service orders.
1 change: 1 addition & 0 deletions fieldservice_timesheet/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import timesheets_analysis_report
35 changes: 35 additions & 0 deletions fieldservice_timesheet/report/report_timesheet_templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="report_timesheet" inherit_id="hr_timesheet.report_timesheet">
<xpath expr="//t[@t-set='show_project']" position="after">
<t
t-set="show_fsm_order"
t-value="bool(docs.mapped('fsm_order_id'))"
groups="fieldservice.group_fsm_user"
/>
</xpath>
</template>
<template id="timesheet_table" inherit_id="hr_timesheet.timesheet_table">
<xpath expr="//table[hasclass('table-sm')]/thead/tr/th[3]" position="after">
<th
t-if="show_fsm_order"
groups="fieldservice.group_fsm_user"
>Field Service Order</th>
</xpath>
<xpath expr="//table[hasclass('table-sm')]/tbody/tr[1]/td[3]" position="after">
<td t-if="show_fsm_order" groups="fieldservice.group_fsm_user">
<span t-field="line.fsm_order_id.number" /> - <span
t-field="line.fsm_order_id.name"
/>
</td>
</xpath>
<xpath expr="//table[hasclass('table-sm')]/tbody/tr[2]/td" position="before">
<t
t-if="show_fsm_order"
t-set="nbCols"
t-value="nbCols + 1"
groups="fieldservice.group_fsm_user"
/>
</xpath>
</template>
</odoo>
21 changes: 21 additions & 0 deletions fieldservice_timesheet/report/timesheets_analysis_report.py
Original file line number Diff line number Diff line change
@@ -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
"""
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading