Skip to content

Commit

Permalink
[MIG] hr_holidays_public: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviedoanhduy committed Feb 25, 2025
1 parent 0c1d77d commit a6b4bac
Show file tree
Hide file tree
Showing 23 changed files with 147 additions and 850 deletions.
69 changes: 35 additions & 34 deletions hr_holidays_public/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ HR Holidays Public
: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/17.0/hr_holidays_public
:target: https://github.com/OCA/hr-holidays/tree/18.0/hr_holidays_public
: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-17-0/hr-holidays-17-0-hr_holidays_public
:target: https://translation.odoo-community.org/projects/hr-holidays-18-0/hr-holidays-18-0-hr_holidays_public
: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=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr-holidays&target_branch=18.0
:alt: Try me on Runboat

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

This module handles public holidays.

The calculation of each leave can exclude rest public holiday, depending
on the leave type configuration.

Expand All @@ -47,14 +45,15 @@ Configuration
Go to *Time Off -> Configuration -> Time Off Types* and open a Leave
Type

- Check "Exclude Public Holidays" to exclude public holidays.
- Check "Exclude Public Holidays" to exclude public holidays.

Usage
=====

For adding public holidays:

1. Go to the menu *Leaves > Public Holidays > Public Holidays*.
1. Go to the menu *Calendar > Configuration > Public Holidays > Public
Holidays*.
2. Create your public holidays.

For using public holidays on leaves:
Expand Down Expand Up @@ -84,9 +83,10 @@ In Odoo 12.0, \_leave_intervals() returns Intervals which is a list of
tuples (start_timestamp, end_timestamp, resource.calendar.leaves
record). Since this module does not operate with
resource.calendar.leaves, it's setting third component of a tuple to a
hr.holidays.public.line record. This may or may not be a problem, yet
since this component is also being set to resource.calendar.attendance
records in \_attendance_intervals(), seems it should be ok.
calendar.public.holiday.line record. This may or may not be a problem,
yet since this component is also being set to
resource.calendar.attendance records in \_attendance_intervals(), seems
it should be ok.

There are no restrictions to block users from modifying or removing
calendar events linked to public holidays. There's a suggestion to
Expand All @@ -104,7 +104,7 @@ 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%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/hr-holidays/issues/new?body=module:%20hr_holidays_public%0Aversion:%2018.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.

Expand All @@ -123,43 +123,44 @@ Authors
Contributors
------------

- Michael Telahun Makonnen <[email protected]>
- Fekete Mihai <[email protected]>
- Nikolina Todorova <[email protected]>
- Alexis de Lattre <[email protected]>
- Salton Massally (iDT Labs) <[email protected]>
- Ivan Yelizariev <[email protected]>
- Bassirou Ndaw <[email protected]>
- Dhara Solanki <[email protected]>
- `Tecnativa <https://www.tecnativa.com>`__:
- Michael Telahun Makonnen <[email protected]>
- Fekete Mihai <[email protected]>
- Nikolina Todorova <[email protected]>
- Alexis de Lattre <[email protected]>
- Salton Massally (iDT Labs) <[email protected]>
- Ivan Yelizariev <[email protected]>
- Bassirou Ndaw <[email protected]>
- Dhara Solanki <[email protected]>
- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- Pedro M. Baeza

- `CorporateHub <https://corporatehub.eu/>`__
- `CorporateHub <https://corporatehub.eu/>`__

- Alexey Pelykh <[email protected]>
- Alexey Pelykh <[email protected]>

- `Camptocamp <https://www.camptocamp.com>`__:
- `Camptocamp <https://www.camptocamp.com>`__:

- Damien Crier <[email protected]>
- Damien Crier <[email protected]>

- `Druidoo <https://www.druidoo.io>`__:
- `Druidoo <https://www.druidoo.io>`__:

- Iván Todorovich <[email protected]>
- Iván Todorovich <[email protected]>

- `Pesol <https://www.pesol.es>`__:
- `Pesol <https://www.pesol.es>`__:

- Pedro Evaristo Gonzalez Sanchez <[email protected]>
- Pedro Evaristo Gonzalez Sanchez <[email protected]>

- `Trobz <https://trobz.com>`__:
- `Trobz <https://trobz.com>`__:

- Thao Le <[email protected]>
- Thao Le <[email protected]>
- Do Anh Duy <[email protected]>

Other credits
-------------

The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp.
The migration of this module from 16.0 to 17.0 and then from 17.0 to
18.0 was financially supported by Camptocamp.

Maintainers
-----------
Expand All @@ -174,6 +175,6 @@ 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-holidays <https://github.com/OCA/hr-holidays/tree/17.0/hr_holidays_public>`_ project on GitHub.
This module is part of the `OCA/hr-holidays <https://github.com/OCA/hr-holidays/tree/18.0/hr_holidays_public>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 0 additions & 1 deletion hr_holidays_public/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
from . import wizards
10 changes: 5 additions & 5 deletions hr_holidays_public/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "HR Holidays Public",
"version": "17.0.1.0.6",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"category": "Human Resources",
"author": "Michael Telahun Makonnen, "
Expand All @@ -14,13 +14,13 @@
"Odoo Community Association (OCA),",
"summary": "Manage Public Holidays",
"website": "https://github.com/OCA/hr-holidays",
"depends": ["hr_holidays"],
"depends": [
"hr_holidays",
"calendar_public_holiday",
],
"data": [
"data/data.xml",
"security/ir.model.access.csv",
"views/hr_holidays_public_view.xml",
"views/hr_leave_type.xml",
"wizards/holidays_public_next_year_wizard.xml",
],
"installable": True,
}
6 changes: 0 additions & 6 deletions hr_holidays_public/data/data.xml

This file was deleted.

1 change: 0 additions & 1 deletion hr_holidays_public/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
from . import hr_employee
from . import hr_leave
from . import hr_leave_type
from . import hr_holidays_public
from . import resource_calendar
2 changes: 1 addition & 1 deletion hr_holidays_public/models/hr_employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _get_public_holiday_lines(self, date_start, date_end):
domain = self.env["hr.leave"]._get_domain_from_get_unusual_days(

Check warning on line 13 in hr_holidays_public/models/hr_employee.py

View check run for this annotation

Codecov / codecov/patch

hr_holidays_public/models/hr_employee.py#L13

Added line #L13 was not covered by tests
date_from=date_start, date_to=date_end
)
return self.env["hr.holidays.public.line"].search(domain)
return self.env["calendar.public.holiday.line"].search(domain)

Check warning on line 16 in hr_holidays_public/models/hr_employee.py

View check run for this annotation

Codecov / codecov/patch

hr_holidays_public/models/hr_employee.py#L16

Added line #L16 was not covered by tests

@api.model
def get_public_holidays_data(self, date_start, date_end):
Expand Down
Loading

0 comments on commit a6b4bac

Please sign in to comment.