@ -0,0 +1,46 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-green.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
HR Holiday Generator |
||||
|
==================== |
||||
|
* This module allow to generate public holidays of selected country |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
- Install our custom addon |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
GNU AFFERO GENERAL PUBLIC LICENSE v3.0 (AGPL-3) |
||||
|
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
Developer: (V18) Nivedhya T ,Contact : odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit https://www.cybrosys.com |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
from . import models |
||||
|
from . import wizard |
@ -0,0 +1,48 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
{ |
||||
|
"name": "HR Holiday Generator", |
||||
|
"version": "18.0.1.0.0", |
||||
|
"category": 'Human Resources', |
||||
|
"summary": """Generate public holidays based on selected criteria.""", |
||||
|
"description": """This module allows you to generate public holidays based |
||||
|
on selected criteria such as year, month, or a specific date.It provides a |
||||
|
wizard that communicates with an external API to fetch public holiday data |
||||
|
and create corresponding calendar leaves.You can customize the criteria and |
||||
|
view the generated holidays within the wizard itself.""", |
||||
|
"author": "Cybrosys Techno Solutions", |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
"depends": ["hr_holidays"], |
||||
|
"data": ["security/ir.model.access.csv", |
||||
|
"views/res_config_settings_views.xml", |
||||
|
"views/holiday_log_views.xml", |
||||
|
"wizard/overlapping_date_views.xml", |
||||
|
"wizard/hr_holiday_generator_views.xml", |
||||
|
"wizard/calendar_leave_generator_views.xml"], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
## Module <hr_holiday_generator> |
||||
|
#### 10.03.2025 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
##### ADD |
||||
|
|
||||
|
- Initial Commit for HR Holiday Generator |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
from . import holiday_log |
||||
|
from . import res_config_settings |
@ -0,0 +1,36 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class HolidayLog(models.Model): |
||||
|
"""The model is for showing the holiday logs""" |
||||
|
_name = "holiday.log" |
||||
|
_description = "Holiday Logs" |
||||
|
|
||||
|
name = fields.Char(string="Name", help="name of the public holiday") |
||||
|
start_date = fields.Datetime(string="Start Date", |
||||
|
help="Start date of the public holiday") |
||||
|
end_date = fields.Datetime(string="End Date", |
||||
|
help="End date of the public holiday") |
||||
|
description = fields.Char(string="Description", |
||||
|
help="Description of the public holiday") |
@ -0,0 +1,36 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ResConfigSettings(models.TransientModel): |
||||
|
"""This model is to add an api key and boolean field in the settings""" |
||||
|
_inherit = "res.config.settings" |
||||
|
|
||||
|
holiday_api = fields.Boolean( |
||||
|
string="Holiday Api", |
||||
|
config_parameter='hr_holiday_generator.holiday_api', |
||||
|
help="A boolean to show and hide the api key field.") |
||||
|
holiday_api_key = fields.Char( |
||||
|
string="Api Key", |
||||
|
config_parameter='hr_holiday_generator.holiday_api_key', |
||||
|
help="Please enter the calendarific API key here.") |
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 573 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 196 KiB |
After Width: | Height: | Size: 198 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 151 KiB |
After Width: | Height: | Size: 159 KiB |
After Width: | Height: | Size: 156 KiB |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 218 KiB |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 153 KiB |
After Width: | Height: | Size: 709 KiB |
After Width: | Height: | Size: 37 KiB |
@ -0,0 +1,49 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Tree view of the model holiday log--> |
||||
|
<record id="holiday_log_view_tree" model="ir.ui.view"> |
||||
|
<field name="name">holiday.log.view.tree</field> |
||||
|
<field name="model">holiday.log</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<list> |
||||
|
<field name="name"/> |
||||
|
<field name="start_date"/> |
||||
|
<field name="end_date"/> |
||||
|
<field name="description"/> |
||||
|
</list> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Form view of the model holiday log--> |
||||
|
<record id="holiday_log_view_form" model="ir.ui.view"> |
||||
|
<field name="name">holiday.log.view.form</field> |
||||
|
<field name="model">holiday.log</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<sheet> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="name"/> |
||||
|
<field name="start_date"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="end_date"/> |
||||
|
<field name="description"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Action of the views--> |
||||
|
<record id="holiday_log_action" model="ir.actions.act_window"> |
||||
|
<field name="name">Holiday Logs</field> |
||||
|
<field name="res_model">holiday.log</field> |
||||
|
<field name="view_mode">list,form</field> |
||||
|
</record> |
||||
|
<!-- Adding menu--> |
||||
|
<menuitem id="holiday_log_menu" |
||||
|
name="Holiday Logs" |
||||
|
parent="hr_holidays.menu_hr_holidays_configuration" |
||||
|
action="holiday_log_action" |
||||
|
sequence="11"/> |
||||
|
</odoo> |
@ -0,0 +1,47 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Inheriting settings and adding the new field inside the general settings--> |
||||
|
<record id="res_config_settings_view_form" model="ir.ui.view"> |
||||
|
<field name="name"> |
||||
|
res.config.settings.view.form.inherit.hr.holiday.generator |
||||
|
</field> |
||||
|
<field name="model">res.config.settings</field> |
||||
|
<field name="inherit_id" |
||||
|
ref="base_setup.res_config_settings_view_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//div[@id = 'invite_users']" position="after"> |
||||
|
<div id="timeoff"> |
||||
|
<h2>Time off</h2> |
||||
|
<div class="row mt16 o_settings_container" |
||||
|
name="timeoff_setting_container"> |
||||
|
<div class="col-12 col-lg-12 o_setting_box" |
||||
|
id="timeoff_setting"> |
||||
|
<div class="col-12 col-lg-12 o_setting_box" |
||||
|
id="holiday_generator_api_key"> |
||||
|
<div class="o_setting_left_pane"> |
||||
|
<field name="holiday_api"/> |
||||
|
</div> |
||||
|
<div class="o_setting_right_pane" |
||||
|
id="timeoff_holiday_settings"> |
||||
|
<label string="Public Holiday" |
||||
|
for="holiday_api"/> |
||||
|
<div class="text-muted"> |
||||
|
Public Holidays |
||||
|
</div> |
||||
|
<div class="content-group"> |
||||
|
<div class="content-group mt16" |
||||
|
invisible="holiday_api != True"> |
||||
|
<label for="holiday_api_key" |
||||
|
class="o_form_label col-1 col-lg-1 o_light_label"/> |
||||
|
<field name="holiday_api_key" password="1"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,25 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
from . import calendar_leave |
||||
|
from . import calendar_leave_generator |
||||
|
from . import hr_holiday_generator |
||||
|
from . import overlapping_date |
@ -0,0 +1,59 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class CalendarLeave(models.TransientModel): |
||||
|
"""Transient model for showing the values in hr holiday generator wizard""" |
||||
|
_name = 'calendar.leave' |
||||
|
_description = 'Calendar Leave' |
||||
|
|
||||
|
holiday_generator_id = fields.Many2one('hr.holiday.generator', |
||||
|
string='Holiday Generator', |
||||
|
help="A Many2one field to connect to" |
||||
|
"the model hr_holiday_generator" |
||||
|
) |
||||
|
name = fields.Char(string="Name", help="name of the public holiday") |
||||
|
start_date = fields.Datetime(string="Start Date", |
||||
|
help="Start date of the public holiday") |
||||
|
end_date = fields.Datetime(string="End Date", |
||||
|
help="End date of the public holiday") |
||||
|
description = fields.Char(string="Description", |
||||
|
help="Description of the public holiday") |
||||
|
warning = fields.Boolean(string="Warning", |
||||
|
help="Warning to show holidays of same dates", |
||||
|
compute="compute_warning", default=False) |
||||
|
calendar_leave_generator_id = fields.Many2one( |
||||
|
"calendar.leave.generator", |
||||
|
string="Calendar leave generator", |
||||
|
help="For connecting with calendar leave generator") |
||||
|
|
||||
|
@api.depends('start_date') |
||||
|
def compute_warning(self): |
||||
|
"""Compute function for the boolean warning""" |
||||
|
for record in self: |
||||
|
same_date_records = self.filtered( |
||||
|
lambda dates: dates.start_date == record.start_date and |
||||
|
dates.id != record.id) |
||||
|
for dates in same_date_records: |
||||
|
dates.warning = True |
||||
|
record.warning = bool(same_date_records) |