diff --git a/hr_employee_partner_external_timesheet/README.rst b/hr_employee_partner_external_timesheet/README.rst new file mode 100644 index 00000000000..5d79f70765f --- /dev/null +++ b/hr_employee_partner_external_timesheet/README.rst @@ -0,0 +1,82 @@ +=================================== +Employee external Partner timesheet +=================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:5e9a22ce59623692bd1edd722c8988e4a9f297e3a6f4e67b070e1ee09faf7488 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fhr-lightgray.png?logo=github + :target: https://github.com/OCA/hr/tree/17.0/hr_employee_partner_external_timesheet + :alt: OCA/hr +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/hr-17-0/hr-17-0-hr_employee_partner_external_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/hr&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a group by external partner in the timesheet views. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +You just have to open timesheet views and you will have an external +partner group by field + +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 +------- + +* INVITU SARL + +Contributors +------------ + +- INVITU SARL, Cyril VINH-TUNG cyril@invitu.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/hr `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_employee_partner_external_timesheet/__init__.py b/hr_employee_partner_external_timesheet/__init__.py new file mode 100644 index 00000000000..4f535014f95 --- /dev/null +++ b/hr_employee_partner_external_timesheet/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2025 INVITU SARL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models +from . import report diff --git a/hr_employee_partner_external_timesheet/__manifest__.py b/hr_employee_partner_external_timesheet/__manifest__.py new file mode 100644 index 00000000000..edafbf1a5d7 --- /dev/null +++ b/hr_employee_partner_external_timesheet/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2025 INVITU SARL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Employee external Partner timesheet", + "summary": "Include external partners to timesheet views", + "version": "17.0.1.0.0", + "category": "Human Resources", + "author": "INVITU SARL, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/hr", + "license": "AGPL-3", + "depends": [ + "hr_timesheet", + "hr_employee_partner_external", + ], + "data": ["views/hr_timesheet_views.xml"], +} diff --git a/hr_employee_partner_external_timesheet/i18n/hr_employee_partner_external_timesheet.pot b/hr_employee_partner_external_timesheet/i18n/hr_employee_partner_external_timesheet.pot new file mode 100644 index 00000000000..8f9e5202082 --- /dev/null +++ b/hr_employee_partner_external_timesheet/i18n/hr_employee_partner_external_timesheet.pot @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_partner_external_timesheet +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-01-09 09:52+0000\n" +"PO-Revision-Date: 2025-01-09 09:52+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: hr_employee_partner_external_timesheet +#: model:ir.model,name:hr_employee_partner_external_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: hr_employee_partner_external_timesheet +#: model_terms:ir.ui.view,arch_db:hr_employee_partner_external_timesheet.hr_timesheet_line_external_partner_search +msgid "External Employee" +msgstr "" + +#. module: hr_employee_partner_external_timesheet +#: model:ir.model.fields,field_description:hr_employee_partner_external_timesheet.field_account_analytic_line__external_partner_id +#: model:ir.model.fields,field_description:hr_employee_partner_external_timesheet.field_timesheets_analysis_report__external_partner_id +#: model_terms:ir.ui.view,arch_db:hr_employee_partner_external_timesheet.hr_timesheet_line_external_partner_search +msgid "External Partner" +msgstr "" + +#. module: hr_employee_partner_external_timesheet +#: model_terms:ir.ui.view,arch_db:hr_employee_partner_external_timesheet.hr_timesheet_line_external_partner_search +msgid "Internal Employee" +msgstr "" + +#. module: hr_employee_partner_external_timesheet +#: model:ir.model.fields,field_description:hr_employee_partner_external_timesheet.field_account_analytic_line__is_external +msgid "Is an external Employee" +msgstr "" + +#. module: hr_employee_partner_external_timesheet +#: model:ir.model.fields,help:hr_employee_partner_external_timesheet.field_account_analytic_line__external_partner_id +msgid "Partner that administrate Employee that works in the Company" +msgstr "" + +#. module: hr_employee_partner_external_timesheet +#: model:ir.model,name:hr_employee_partner_external_timesheet.model_timesheets_analysis_report +msgid "Timesheets Analysis Report" +msgstr "" diff --git a/hr_employee_partner_external_timesheet/models/__init__.py b/hr_employee_partner_external_timesheet/models/__init__.py new file mode 100644 index 00000000000..cb831272915 --- /dev/null +++ b/hr_employee_partner_external_timesheet/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2025 INVITU SARL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import hr_timesheet diff --git a/hr_employee_partner_external_timesheet/models/hr_timesheet.py b/hr_employee_partner_external_timesheet/models/hr_timesheet.py new file mode 100644 index 00000000000..3f8d762dfef --- /dev/null +++ b/hr_employee_partner_external_timesheet/models/hr_timesheet.py @@ -0,0 +1,13 @@ +# Copyright 2025 INVITU SARL +# 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" + + external_partner_id = fields.Many2one( + "res.partner", related="employee_id.hr_external_partner_id", store=True + ) + is_external = fields.Boolean(related="employee_id.is_external") diff --git a/hr_employee_partner_external_timesheet/pyproject.toml b/hr_employee_partner_external_timesheet/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/hr_employee_partner_external_timesheet/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_employee_partner_external_timesheet/readme/CONTRIBUTORS.md b/hr_employee_partner_external_timesheet/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..821c7ea7f23 --- /dev/null +++ b/hr_employee_partner_external_timesheet/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- INVITU SARL, Cyril VINH-TUNG diff --git a/hr_employee_partner_external_timesheet/readme/DESCRIPTION.md b/hr_employee_partner_external_timesheet/readme/DESCRIPTION.md new file mode 100644 index 00000000000..cdb854cea00 --- /dev/null +++ b/hr_employee_partner_external_timesheet/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module adds a group by external partner in the timesheet views. diff --git a/hr_employee_partner_external_timesheet/readme/USAGE.md b/hr_employee_partner_external_timesheet/readme/USAGE.md new file mode 100644 index 00000000000..11bec0aa737 --- /dev/null +++ b/hr_employee_partner_external_timesheet/readme/USAGE.md @@ -0,0 +1 @@ +You just have to open timesheet views and you will have an external partner group by field diff --git a/hr_employee_partner_external_timesheet/report/__init__.py b/hr_employee_partner_external_timesheet/report/__init__.py new file mode 100644 index 00000000000..8d96536a4bf --- /dev/null +++ b/hr_employee_partner_external_timesheet/report/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2025 INVITU SARL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import timesheets_analysis_report diff --git a/hr_employee_partner_external_timesheet/report/timesheets_analysis_report.py b/hr_employee_partner_external_timesheet/report/timesheets_analysis_report.py new file mode 100644 index 00000000000..da5f7602ccb --- /dev/null +++ b/hr_employee_partner_external_timesheet/report/timesheets_analysis_report.py @@ -0,0 +1,22 @@ +# Copyright 2025 INVITU SARL +# 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" + + external_partner_id = fields.Many2one( + "res.partner", string="External Partner", readonly=True + ) + is_external = fields.Boolean(related="employee_id.is_external", readonly=True) + + @api.model + def _select(self): + return ( + super()._select() + + """, + A.external_partner_id AS external_partner_id + """ + ) diff --git a/hr_employee_partner_external_timesheet/static/description/icon.png b/hr_employee_partner_external_timesheet/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/hr_employee_partner_external_timesheet/static/description/icon.png differ diff --git a/hr_employee_partner_external_timesheet/static/description/index.html b/hr_employee_partner_external_timesheet/static/description/index.html new file mode 100644 index 00000000000..06e31db0a66 --- /dev/null +++ b/hr_employee_partner_external_timesheet/static/description/index.html @@ -0,0 +1,429 @@ + + + + + +Employee external Partner timesheet + + + +
+

Employee external Partner timesheet

+ + +

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

+

This module adds a group by external partner in the timesheet views.

+

Table of contents

+ +
+

Usage

+

You just have to open timesheet views and you will have an external +partner group by field

+
+
+

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

+
    +
  • INVITU SARL
  • +
+
+
+

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/hr project on GitHub.

+

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

+
+
+
+ + diff --git a/hr_employee_partner_external_timesheet/views/hr_timesheet_views.xml b/hr_employee_partner_external_timesheet/views/hr_timesheet_views.xml new file mode 100644 index 00000000000..cceb5c64033 --- /dev/null +++ b/hr_employee_partner_external_timesheet/views/hr_timesheet_views.xml @@ -0,0 +1,34 @@ + + + + account.analytic.line.external.partner.search + account.analytic.line + + + + + + + + + + + + + + + +