Skip to content
Merged
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
100 changes: 100 additions & 0 deletions calendar_public_holiday/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

========================
Calendar Holidays Public
========================

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

.. |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/license-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%2Fcalendar-lightgray.png?logo=github
:target: https://github.com/OCA/calendar/tree/19.0/calendar_public_holiday
:alt: OCA/calendar
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/calendar-19-0/calendar-19-0-calendar_public_holiday
: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/calendar&target_branch=19.0
:alt: Try me on Runboat

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

This module handles public holidays.

**Table of contents**

.. contents::
:local:

Usage
=====

For adding public holidays:

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

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

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

* Michael Telahun Makonnen
* Tecnativa
* Fekete Mihai (Forest and Biomass Services Romania)
* Druidoo
* Camptocamp
*

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

- [Trobz](https://trobz.com):

- Do Anh Duy <<duyda@trobz.com>>

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

The creation of this module was financially supported by Camptocamp

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/calendar <https://github.com/OCA/calendar/tree/19.0/calendar_public_holiday>`_ 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 calendar_public_holiday/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
from . import wizards
from .hooks import pre_init_hook
31 changes: 31 additions & 0 deletions calendar_public_holiday/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2015 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>
# Copyright 2020 InitOS Gmbh
# Copyright 2024 Camptocamp
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Calendar Holidays Public",
"summary": """
Manage Public Holidays
""",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"category": "HR/Calendar",
"author": "Michael Telahun Makonnen, "
"Tecnativa, "
"Fekete Mihai (Forest and Biomass Services Romania), "
"Druidoo, "
"Odoo Community Association (OCA), "
"Camptocamp,",
"website": "https://github.com/OCA/calendar",
"depends": ["calendar"],
"external_dependencies": {"python": ["openupgradelib"]},
"data": [
"data/data.xml",
"security/ir.model.access.csv",
"views/calendar_public_holiday_view.xml",
"wizards/calendar_public_holiday_next_year_wizard.xml",
],
"pre_init_hook": "pre_init_hook",
"installable": True,
}
8 changes: 8 additions & 0 deletions calendar_public_holiday/data/data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--Copyright 2024 Camptocamp
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).-->
<odoo>
<record id="event_type_holiday" model="calendar.event.type">
<field name="name">Public Holidays</field>
</record>
</odoo>
62 changes: 62 additions & 0 deletions calendar_public_holiday/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright 2024 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


def migrate_rename_xmlid_event_type_holiday(env):
if not openupgrade.is_module_installed(env.cr, "hr_holidays_public"):
return
xmlid_renames = [
(
"hr_holidays_public.event_type_holiday",
"calendar_public_holiday.event_type_holiday",
),
]
openupgrade.rename_xmlids(env.cr, xmlid_renames)


def migrate_rename_field_model_hr_holidays_public_line(env):
field_renames = [
(
"hr.holidays.public.line",
"hr_holidays_public_line",
"year_id",
"public_holiday_id",
),
]
openupgrade.rename_fields(env, field_renames, no_deep=True)


def migrate_rename_model_hr_holidays_public_line(env):
if not openupgrade.table_exists(env.cr, "hr_holidays_public_line"):
return
model_renames = [("hr.holidays.public.line", "calendar.public.holiday.line")]
openupgrade.rename_models(env.cr, model_renames)
tables_renames = [("hr_holidays_public_line", "calendar_public_holiday_line")]
openupgrade.rename_tables(env.cr, tables_renames)
# Rename Many2many relation
tables_renames = [("hr_holiday_public_state_rel", "public_holiday_state_rel")]
openupgrade.rename_tables(env.cr, tables_renames)
column_renames = {
"public_holiday_state_rel": [("line_id", "public_holiday_line_id")],
}
openupgrade.rename_columns(env.cr, column_renames)


def migrate_rename_model_hr_holidays_public(env):
if not openupgrade.table_exists(env.cr, "hr_holidays_public"):
return
model_renames = [
("hr.holidays.public", "calendar.public.holiday"),
]
openupgrade.rename_models(env.cr, model_renames)
tables_renames = [("hr_holidays_public", "calendar_public_holiday")]
openupgrade.rename_tables(env.cr, tables_renames)


def pre_init_hook(env):
migrate_rename_xmlid_event_type_holiday(env)
migrate_rename_field_model_hr_holidays_public_line(env)
migrate_rename_model_hr_holidays_public_line(env)
migrate_rename_model_hr_holidays_public(env)
Loading