Skip to content

Commit

Permalink
[ADD] add hr_employee_partner_external_timesheet module
Browse files Browse the repository at this point in the history
  • Loading branch information
cvinh committed Jan 9, 2025
1 parent 9493dba commit 4369ffc
Show file tree
Hide file tree
Showing 15 changed files with 669 additions and 0 deletions.
82 changes: 82 additions & 0 deletions hr_employee_partner_external_timesheet/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/hr/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/hr/issues/new?body=module:%20hr_employee_partner_external_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
-------

* INVITU SARL

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

- INVITU SARL, Cyril VINH-TUNG [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.

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions hr_employee_partner_external_timesheet/__init__.py
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions hr_employee_partner_external_timesheet/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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"],
}
Original file line number Diff line number Diff line change
@@ -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 ""
4 changes: 4 additions & 0 deletions hr_employee_partner_external_timesheet/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2025 INVITU SARL
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import hr_timesheet
13 changes: 13 additions & 0 deletions hr_employee_partner_external_timesheet/models/hr_timesheet.py
Original file line number Diff line number Diff line change
@@ -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")
3 changes: 3 additions & 0 deletions hr_employee_partner_external_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"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- INVITU SARL, Cyril VINH-TUNG <[email protected]>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds a group by external partner in the timesheet views.
1 change: 1 addition & 0 deletions hr_employee_partner_external_timesheet/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You just have to open timesheet views and you will have an external partner group by field
4 changes: 4 additions & 0 deletions hr_employee_partner_external_timesheet/report/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
"""
)
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 4369ffc

Please sign in to comment.