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
93 changes: 93 additions & 0 deletions hr_holidays_public_overtime/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
=============================
HR Holidays Public (overtime)
=============================

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

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

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

This module adds support for public holidays in Odoo's overtime calculation.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

#. Go to Attendances, and record time on a date that is a public holiday for your employee
#. Observe the time recorded is counted as extra hours

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr-holidays/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-holidays/issues/new?body=module:%20hr_holidays_public_overtime%0Aversion:%2016.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
~~~~~~~

* Hunki Enterprises BV
* verdigado eG

Contributors
~~~~~~~~~~~~

* Holger Brunn <mail@hunki-enterprises.com> (https://hunki-enterprises.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.

.. |maintainer-hbrunn| image:: https://github.com/hbrunn.png?size=40px
:target: https://github.com/hbrunn
:alt: hbrunn

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

|maintainer-hbrunn|

This module is part of the `OCA/hr-holidays <https://github.com/OCA/hr-holidays/tree/16.0/hr_holidays_public_overtime>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions hr_holidays_public_overtime/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions hr_holidays_public_overtime/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 Hunki Enterprises BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)

{
"name": "HR Holidays Public (overtime)",
"summary": "Support public holidays in overtime calculations",
"version": "16.0.1.0.0",
"development_status": "Beta",
"category": "Human Resources",
"website": "https://github.com/OCA/hr-holidays",
"author": "Hunki Enterprises BV, Odoo Community Association (OCA), verdigado eG",
"maintainers": ["hbrunn"],
"license": "AGPL-3",
"depends": [
"hr_holidays_public",
"hr_attendance",
],
"auto_install": True,
}
22 changes: 22 additions & 0 deletions hr_holidays_public_overtime/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_holidays_public_overtime
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-01 10:34+0000\n"
"Last-Translator: Alexander Bigga <alexander@bigga.de>\n"
"Language-Team: none\n"
"Language: de\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 4.17\n"

#. module: hr_holidays_public_overtime
#: model:ir.model,name:hr_holidays_public_overtime.model_hr_attendance
msgid "Attendance"
msgstr "Anwesenheit"
19 changes: 19 additions & 0 deletions hr_holidays_public_overtime/i18n/hr_holidays_public_overtime.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_holidays_public_overtime
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.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: hr_holidays_public_overtime
#: model:ir.model,name:hr_holidays_public_overtime.model_hr_attendance
msgid "Attendance"
msgstr ""
22 changes: 22 additions & 0 deletions hr_holidays_public_overtime/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_holidays_public_overtime
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-23 19:37+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 4.17\n"

#. module: hr_holidays_public_overtime
#: model:ir.model,name:hr_holidays_public_overtime.model_hr_attendance
msgid "Attendance"
msgstr "Presenza"
1 change: 1 addition & 0 deletions hr_holidays_public_overtime/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import hr_attendance
28 changes: 28 additions & 0 deletions hr_holidays_public_overtime/models/hr_attendance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2023 Hunki Enterprises BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)

from collections import defaultdict

from odoo import models


class HrAttendance(models.Model):
_inherit = "hr.attendance"

def _update_overtime(self, employee_attendance_dates=None):
"""Set the flag in context to exclude public holidays"""
if employee_attendance_dates is None:
employee_attendance_dates = self._get_attendances_dates()
# also set the flag on the employees' context as some code paths get dates from there
employee_attendance_dates = defaultdict(
employee_attendance_dates.default_factory,
{
employee.with_context(
exclude_public_holidays=True, employee_id=employee.id
): dates
for employee, dates in employee_attendance_dates.items()
},
)
return super(
HrAttendance, self.with_context(exclude_public_holidays=True)
)._update_overtime(employee_attendance_dates=employee_attendance_dates)
1 change: 1 addition & 0 deletions hr_holidays_public_overtime/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Holger Brunn <mail@hunki-enterprises.com> (https://hunki-enterprises.com)
1 change: 1 addition & 0 deletions hr_holidays_public_overtime/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds support for public holidays in Odoo's overtime calculation.
4 changes: 4 additions & 0 deletions hr_holidays_public_overtime/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To use this module, you need to:

#. Go to Attendances, and record time on a date that is a public holiday for your employee
#. Observe the time recorded is counted as extra hours
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading