diff --git a/hr_holiday_generator/README.rst b/hr_holiday_generator/README.rst new file mode 100755 index 000000000..d2a9c38bf --- /dev/null +++ b/hr_holiday_generator/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +HR Holiday Generator +==================== +* This module allow to generate public holidays of selected country + +Configuration +============= + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). + +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V15) Mohammed Irfan T ,Contact : odoo@cybrosys.com +Developer: (V16) Anusha C ,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: ``__ diff --git a/hr_holiday_generator/__init__.py b/hr_holiday_generator/__init__.py new file mode 100755 index 000000000..8107e5aa0 --- /dev/null +++ b/hr_holiday_generator/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Mohammed Irfan T (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import models +from . import wizard diff --git a/hr_holiday_generator/__manifest__.py b/hr_holiday_generator/__manifest__.py new file mode 100755 index 000000000..4b21a925e --- /dev/null +++ b/hr_holiday_generator/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Mohammed Irfan T (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +{ + "name": "HR Holiday Generator", + "version": "15.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.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_holiday_generator/doc/RELEASE_NOTES.md b/hr_holiday_generator/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..b4f9f21f5 --- /dev/null +++ b/hr_holiday_generator/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module +#### 28.06.2024 +#### Version 15.0.1.0.0 +##### ADD + +- Initial Commit for HR Holiday Generator diff --git a/hr_holiday_generator/models/__init__.py b/hr_holiday_generator/models/__init__.py new file mode 100755 index 000000000..44b1466cf --- /dev/null +++ b/hr_holiday_generator/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Mohammed Irfan T (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import holiday_log +from . import res_config_settings diff --git a/hr_holiday_generator/models/holiday_log.py b/hr_holiday_generator/models/holiday_log.py new file mode 100755 index 000000000..481ad399a --- /dev/null +++ b/hr_holiday_generator/models/holiday_log.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Mohammed Irfan T (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +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") diff --git a/hr_holiday_generator/models/res_config_settings.py b/hr_holiday_generator/models/res_config_settings.py new file mode 100755 index 000000000..501908941 --- /dev/null +++ b/hr_holiday_generator/models/res_config_settings.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Mohammed Irfan T (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +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.") diff --git a/hr_holiday_generator/security/ir.model.access.csv b/hr_holiday_generator/security/ir.model.access.csv new file mode 100755 index 000000000..3a0008de2 --- /dev/null +++ b/hr_holiday_generator/security/ir.model.access.csv @@ -0,0 +1,6 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_hr_holiday_generator_user,access.hr.holiday.generator.user,model_hr_holiday_generator,base.group_user,1,1,1,1 +access_calendar_leave_user,access.calendar.leave.user,model_calendar_leave,base.group_user,1,1,1,1 +access_holiday_log_user,access.holiday.log.user,model_holiday_log,base.group_user,1,1,1,1 +access_overlapping_date_user,access.overlapping.date.user,model_overlapping_date,base.group_user,1,1,1,1 +access_calendar_leave_generator_user,access.calendar.leave.generator.user,model_calendar_leave_generator,base.group_user,1,1,1,1 diff --git a/hr_holiday_generator/static/description/assets/icons/check.png b/hr_holiday_generator/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/check.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/chevron.png b/hr_holiday_generator/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/chevron.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/cogs.png b/hr_holiday_generator/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/cogs.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/consultation.png b/hr_holiday_generator/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/consultation.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/ecom-black.png b/hr_holiday_generator/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/ecom-black.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/education-black.png b/hr_holiday_generator/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/education-black.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/hotel-black.png b/hr_holiday_generator/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/hotel-black.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/license.png b/hr_holiday_generator/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/license.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/lifebuoy.png b/hr_holiday_generator/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/lifebuoy.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/manufacturing-black.png b/hr_holiday_generator/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/manufacturing-black.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/pos-black.png b/hr_holiday_generator/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/pos-black.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/puzzle.png b/hr_holiday_generator/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/puzzle.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/restaurant-black.png b/hr_holiday_generator/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/restaurant-black.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/service-black.png b/hr_holiday_generator/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/service-black.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/trading-black.png b/hr_holiday_generator/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/trading-black.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/training.png b/hr_holiday_generator/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/training.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/update.png b/hr_holiday_generator/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/update.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/user.png b/hr_holiday_generator/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/user.png differ diff --git a/hr_holiday_generator/static/description/assets/icons/wrench.png b/hr_holiday_generator/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/hr_holiday_generator/static/description/assets/icons/wrench.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/categories.png b/hr_holiday_generator/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/categories.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/check-box.png b/hr_holiday_generator/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/check-box.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/compass.png b/hr_holiday_generator/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/compass.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/corporate.png b/hr_holiday_generator/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/corporate.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/customer-support.png b/hr_holiday_generator/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/customer-support.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/cybrosys-logo.png b/hr_holiday_generator/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/cybrosys-logo.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/features.png b/hr_holiday_generator/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/features.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/logo.png b/hr_holiday_generator/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/logo.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/pictures.png b/hr_holiday_generator/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/pictures.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/pie-chart.png b/hr_holiday_generator/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/pie-chart.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/right-arrow.png b/hr_holiday_generator/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/right-arrow.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/star.png b/hr_holiday_generator/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/star.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/support.png b/hr_holiday_generator/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/support.png differ diff --git a/hr_holiday_generator/static/description/assets/misc/whatsapp.png b/hr_holiday_generator/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/misc/whatsapp.png differ diff --git a/hr_holiday_generator/static/description/assets/modules/1.png b/hr_holiday_generator/static/description/assets/modules/1.png new file mode 100755 index 000000000..5238bdeab Binary files /dev/null and b/hr_holiday_generator/static/description/assets/modules/1.png differ diff --git a/hr_holiday_generator/static/description/assets/modules/2.png b/hr_holiday_generator/static/description/assets/modules/2.png new file mode 100755 index 000000000..1ae7cfe3b Binary files /dev/null and b/hr_holiday_generator/static/description/assets/modules/2.png differ diff --git a/hr_holiday_generator/static/description/assets/modules/3.png b/hr_holiday_generator/static/description/assets/modules/3.png new file mode 100755 index 000000000..3c3ff1afb Binary files /dev/null and b/hr_holiday_generator/static/description/assets/modules/3.png differ diff --git a/hr_holiday_generator/static/description/assets/modules/4.png b/hr_holiday_generator/static/description/assets/modules/4.png new file mode 100755 index 000000000..3fae4631e Binary files /dev/null and b/hr_holiday_generator/static/description/assets/modules/4.png differ diff --git a/hr_holiday_generator/static/description/assets/modules/5.gif b/hr_holiday_generator/static/description/assets/modules/5.gif new file mode 100755 index 000000000..2a5f8e659 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/modules/5.gif differ diff --git a/hr_holiday_generator/static/description/assets/modules/6.png b/hr_holiday_generator/static/description/assets/modules/6.png new file mode 100755 index 000000000..7f2815273 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/modules/6.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/0.png b/hr_holiday_generator/static/description/assets/screenshots/0.png new file mode 100644 index 000000000..a22848af9 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/0.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/1.png b/hr_holiday_generator/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..1d2a73fdf Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/1.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/10.png b/hr_holiday_generator/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..cdd19295c Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/10.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/2.png b/hr_holiday_generator/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..5f3e8bbd6 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/2.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/3.png b/hr_holiday_generator/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..a68cd13f3 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/3.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/4.png b/hr_holiday_generator/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..8b7798aa0 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/4.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/5.png b/hr_holiday_generator/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..eaedfb402 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/5.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/6.png b/hr_holiday_generator/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..b7f827b36 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/6.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/7.png b/hr_holiday_generator/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..d01a015ea Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/7.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/8.png b/hr_holiday_generator/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..3bf27ff6f Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/8.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/9.png b/hr_holiday_generator/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..255b804f8 Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/9.png differ diff --git a/hr_holiday_generator/static/description/assets/screenshots/hero.gif b/hr_holiday_generator/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..2877670bb Binary files /dev/null and b/hr_holiday_generator/static/description/assets/screenshots/hero.gif differ diff --git a/hr_holiday_generator/static/description/banner.png b/hr_holiday_generator/static/description/banner.png new file mode 100644 index 000000000..8522f744e Binary files /dev/null and b/hr_holiday_generator/static/description/banner.png differ diff --git a/hr_holiday_generator/static/description/icon.png b/hr_holiday_generator/static/description/icon.png new file mode 100644 index 000000000..abacad601 Binary files /dev/null and b/hr_holiday_generator/static/description/icon.png differ diff --git a/hr_holiday_generator/static/description/index.html b/hr_holiday_generator/static/description/index.html new file mode 100755 index 000000000..52ad48c65 --- /dev/null +++ b/hr_holiday_generator/static/description/index.html @@ -0,0 +1,682 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ HR Holiday Generator

+

+ Generate Public Holidays Based On Selected Criteria.

+ + +
+
+
+
+ +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module helps user to create Public Holidays based on selected + criteria. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community & + Enterprise Support. +
+
+ + Automatic Public Holidays Generation. +
+
+ + Fetch public holiday data via external API for accuracy. +
+
+ + Easily select Year, Month, or Date criteria for holiday generation. +
+
+ + Automatically convert holiday dates to user's local time zone. +
+
+ + Seamlessly generate calendar leaves for public holidays, enhancing leave management. +
+
+ + Detect overlapping dates, alerting users to prevent duplicate holiday records. +
+
+ + Maintain a log of overlapping holiday dates for effective conflict resolution and future reference. +
+
+ +
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Create an account in Calendarific + site. Select the plan. Copy the generated API key. +

+

Account Dashboard --> Home

+ +
+
+

+ Add your API key from the Calendarific site in the general + settings for data retrieval. +

+ +
+
+

+ Click on the 'GENERATE' button to Initiate fetching and creation + of Public Holidays based on selected criteria. +

+

Time Off --> Configuration --> Holiday Generator

+ +
+
+

+ Click on the 'SAVE' button to store generated Public Holidays + records in the system.

+ +
+
+

+ The screenshot provides a visual overview of the newly generated + Public Holidays.

+ +
+
+

+ When overlapping dates are entered, the module identifies + conflicts and issues a warning when the SAVE button is + clicked.

+ +
+
+

+ The screenshot provides a visual overview of the warning upon + entering overlapping dates.

+ +
+ +
+

+ Records overlapping dates in the Holiday Logs for reference.

+

Time Off --> Configuration --> Holiday Logs

+ +
+
+

+ When holidays of same date are entered, the module identifies + conflicts and issues a warning when the SAVE button is + clicked.

+ +
+
+

+ The screenshot provides a visual overview of the warning upon + entering holidays of same date. Click on CONTINUE button to + continue the process.

+ +
+
+

+ Holidays of same dates can be seen in red colour , select one + holiday among the same dates and click on the SAVE button to + generate Public Holidays in Odoo.

+ +
+
+
+ + + +
+
+ +
+

Related + Products +

+
+
+
+ +
+
+ + + +
+
+ +
+

+ Our Services +

+
+
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+
+
+ +
+
+ Hire + Odoo + Developer
+
+
+
+ +
+
+ Odoo + Integration
+
+
+
+ +
+
+ Odoo + Migration
+
+
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+ +
+

+ Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/hr_holiday_generator/views/holiday_log_views.xml b/hr_holiday_generator/views/holiday_log_views.xml new file mode 100755 index 000000000..1b7cb0abd --- /dev/null +++ b/hr_holiday_generator/views/holiday_log_views.xml @@ -0,0 +1,49 @@ + + + + + holiday.log.view.tree + holiday.log + + + + + + + + + + + + holiday.log.view.form + holiday.log + +
+ + + + + + + + + + + + +
+
+
+ + + Holiday Logs + holiday.log + tree,form + + + +
diff --git a/hr_holiday_generator/views/res_config_settings_views.xml b/hr_holiday_generator/views/res_config_settings_views.xml new file mode 100755 index 000000000..edeeb9f2a --- /dev/null +++ b/hr_holiday_generator/views/res_config_settings_views.xml @@ -0,0 +1,48 @@ + + + + + + res.config.settings.view.form.inherit.hr.holiday.generator + + res.config.settings + + + +
+

Time off

+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
diff --git a/hr_holiday_generator/wizard/__init__.py b/hr_holiday_generator/wizard/__init__.py new file mode 100755 index 000000000..8baef8e9a --- /dev/null +++ b/hr_holiday_generator/wizard/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Mohammed Irfan T (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import calendar_leave +from . import calendar_leave_generator +from . import hr_holiday_generator +from . import overlapping_date diff --git a/hr_holiday_generator/wizard/calendar_leave.py b/hr_holiday_generator/wizard/calendar_leave.py new file mode 100755 index 000000000..c055334d9 --- /dev/null +++ b/hr_holiday_generator/wizard/calendar_leave.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Mohammed Irfan T (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +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) diff --git a/hr_holiday_generator/wizard/calendar_leave_generator.py b/hr_holiday_generator/wizard/calendar_leave_generator.py new file mode 100644 index 000000000..336538d01 --- /dev/null +++ b/hr_holiday_generator/wizard/calendar_leave_generator.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Mohammed Irfan T (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class CalendarLeaveGenerator(models.TransientModel): + """Transient model for showing repeated calendar leaves""" + _name = 'calendar.leave.generator' + _description = 'Calendar Leave Generator' + + calendar_leave_ids = fields.One2many('calendar.leave', + 'calendar_leave_generator_id', + string='Calender Leave', + help="A One2many field to connect to" + "the model calender leave") + + def action_generate(self): + """Function for generating public holidays or showing the warning""" + existing_holiday = self.env['resource.calendar.leaves'].search([ + ('resource_id', '=', False)]) + overlapping_dates = [] + overlapping_logs = [] + new_holiday_dates = [] + same_date_holidays = set() + for existing in existing_holiday: + for new_holiday in self.calendar_leave_ids: + if existing.date_from.date() == \ + new_holiday.start_date.date() or \ + existing.date_to.date() == new_holiday.end_date.date(): + overlapping_dates.append(new_holiday.start_date.date()) + overlapping_logs.append({ + 'name': new_holiday.name, + 'start_date': new_holiday.start_date, + 'end_date': new_holiday.end_date, + 'description': new_holiday.description + }) + break + for new_holiday in self.calendar_leave_ids: + new_date = new_holiday.start_date.date() + if new_date in new_holiday_dates: + same_date_holidays.add(new_date) + else: + new_holiday_dates.append(new_date) + for log in overlapping_logs: + existing_logs = self.env['holiday.log'].search([ + ('name', '=', log['name']), + ('start_date', '>=', log['start_date']), + ('end_date', '<=', log['end_date'])]) + if not existing_logs: + self.env['holiday.log'].create(log) + if overlapping_dates or same_date_holidays: + warning_message = "" + if overlapping_dates: + existing_dates = ", ".join( + date.strftime('%Y-%m-%d') for date in overlapping_dates) + warning_message += ( + f"Public holidays already exist for the following date(s): " + f"{existing_dates}.\nPlease refer to the logs for detailed " + f"information about the public holidays on these dates.\n\n" + ) + if same_date_holidays: + warning_message += "Select only one holiday per date:\n" + warning_message += \ + "The following dates have multiple holidays:\n" + for date in same_date_holidays: + warning_message += f"\n- {date.strftime('%Y-%m-%d')}" + warning = self.env['overlapping.date'].create( + {'warning': warning_message}) + return { + 'name': 'Overlapping Dates Warning', + 'type': 'ir.actions.act_window', + 'res_model': 'overlapping.date', + 'res_id': warning.id, + 'view_mode': 'form', + 'view_id': self.env.ref( + 'hr_holiday_generator.overlapping_date_view_form').id, + 'target': 'new', + 'context': { + 'active_calendar_leave_ids': self.calendar_leave_ids.ids + } + } + else: + self.env['resource.calendar.leaves'].create([{ + 'name': holiday.name, + 'date_from': holiday.start_date, + 'date_to': holiday.end_date + } for holiday in self.calendar_leave_ids]) diff --git a/hr_holiday_generator/wizard/calendar_leave_generator_views.xml b/hr_holiday_generator/wizard/calendar_leave_generator_views.xml new file mode 100644 index 000000000..ea4fbfa01 --- /dev/null +++ b/hr_holiday_generator/wizard/calendar_leave_generator_views.xml @@ -0,0 +1,31 @@ + + + + + calendar.leave.generator.view.form + calendar.leave.generator + +
+ + + + + + + + + + + +
+
+
+
+
+
+
diff --git a/hr_holiday_generator/wizard/hr_holiday_generator.py b/hr_holiday_generator/wizard/hr_holiday_generator.py new file mode 100755 index 000000000..ae0d886b0 --- /dev/null +++ b/hr_holiday_generator/wizard/hr_holiday_generator.py @@ -0,0 +1,198 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Mohammed Irfan T (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +import dateutil +import requests +from dateutil import parser +from odoo import fields, models +from odoo.exceptions import UserError + + +class HrHolidayGenerator(models.TransientModel): + """This model is for creating a wizard and thus generating public holidays + based on selected country.""" + _name = 'hr.holiday.generator' + _description = 'Hr Holiday Generator' + + country_id = fields.Many2one("res.country", string="Country", + help="Select your country from here", + required=True) + generation_mode = fields.Selection( + [('year', 'YEAR'), ('month', 'MONTH'), ('date', 'DATE')], + string="Date/Month/Year", + help="Select date or month or year in which you want to get the public " + "holidays", required=True) + date = fields.Date(string="Date", + default=lambda self: fields.Date.today(), + help="Select the date you want to generate the public " + "holiday") + month = fields.Selection([('1', 'January'), + ('2', 'February'), + ('3', 'March'), + ('4', 'April'), + ('5', 'May'), + ('6', 'June'), + ('7', 'July'), + ('8', 'August'), + ('9', 'September'), + ('10', 'October'), + ('11', 'November'), + ('12', 'December')], string="Month", + help="Select the month you want to generate the " + "public holiday", + default=str(fields.Date.today().month)) + year = fields.Selection( + selection='_get_years_selection', + string="Year", + help="Select the year you want to generate the public holiday", + default=str(fields.Date.today().year)) + calender_leaves_ids = fields.One2many('calendar.leave', + 'holiday_generator_id', + string="Calender leaves", + help="The One2many field to take the " + "values of the model " + "calender_leave") + + def _get_years_selection(self): + """This function is for getting years to select in the field year""" + year_list = [(str(record), str(record)) for record in + range(fields.datetime.now().year - 10, + fields.datetime.now().year + 10)] + return year_list + + def action_generate(self): + """This function is to set the action of button 'Generate'.""" + self.calender_leaves_ids = False + api_key = self.env['ir.config_parameter'].sudo().get_param( + 'hr_holiday_generator.holiday_api_key') or False + if api_key: + base_url = "https://calendarific.com/api/v2/holidays" + url = (f"{base_url}?&api_key={api_key}&country=" + f"{self.country_id.code}") + if self.generation_mode == 'year': + url += f"&year={self.year}" + elif self.generation_mode == 'month': + url += f"&year={self.year}&month={self.month}" + elif self.generation_mode == 'date': + url += (f"&year={self.date.year}&month={self.date.month}" + f"&day={self.date.day}") + response = requests.get(url) + if response.status_code == 200: + holidays_data = response.json() + calendar_leaves = [] + for holiday in holidays_data['response']['holidays']: + iso_datetime = holiday['date']['iso'] + holiday_date = dateutil.parser.parse(iso_datetime).date() + start_datetime = fields.datetime.combine(holiday_date, + fields.time.min) + end_datetime = fields.datetime.combine(holiday_date, + fields.time.max) + calendar_leaves.append(fields.Command.create({ + 'holiday_generator_id': self.id, + 'name': holiday['name'], + 'start_date': start_datetime, + 'end_date': end_datetime, + 'description': holiday['description'] + })) + self.calender_leaves_ids = calendar_leaves + return { + 'type': 'ir.actions.act_window', + 'res_model': 'hr.holiday.generator', + 'res_id': self.id, + 'view_mode': 'form', + 'view_id': self.env.ref( + 'hr_holiday_generator.hr_holiday_generator_view_form').id, + 'target': 'new', + } + else: + raise UserError( + "To retrieve the data, kindly provide the API key in the " + "general settings.") + + def action_save(self): + """This function is to set the action of the button 'save'. """ + existing_holiday = self.env['resource.calendar.leaves'].search([ + ('resource_id', '=', False)]) + overlapping_dates = [] + overlapping_logs = [] + new_holiday_dates = [] + same_date_holidays = set() + for existing in existing_holiday: + for new_holiday in self.calender_leaves_ids: + if existing.date_from.date() == \ + new_holiday.start_date.date() or \ + existing.date_to.date() == new_holiday.end_date.date(): + overlapping_dates.append(new_holiday.start_date.date()) + overlapping_logs.append({ + 'name': new_holiday.name, + 'start_date': new_holiday.start_date, + 'end_date': new_holiday.end_date, + 'description': new_holiday.description + }) + break + for new_holiday in self.calender_leaves_ids: + new_date = new_holiday.start_date.date() + if new_date in new_holiday_dates: + same_date_holidays.add(new_date) + else: + new_holiday_dates.append(new_date) + for log in overlapping_logs: + existing_logs = self.env['holiday.log'].search([ + ('name', '=', log['name']), + ('start_date', '>=', log['start_date']), + ('end_date', '<=', log['end_date']) + ]) + if not existing_logs: + self.env['holiday.log'].create(log) + if overlapping_dates or same_date_holidays: + warning_message = "" + if overlapping_dates: + existing_dates = ", ".join( + date.strftime('%Y-%m-%d') for date in overlapping_dates) + warning_message += ( + f"Public holidays already exist for the following date(s): " + f"{existing_dates}.\nPlease refer to the logs for detailed " + f"information about the public holidays on these dates.\n\n" + ) + if same_date_holidays: + warning_message += "Select only one holiday per date:\n" + warning_message += \ + "The following dates have multiple holidays:\n" + for date in same_date_holidays: + warning_message += f"\n- {date.strftime('%Y-%m-%d')}" + warning = self.env['overlapping.date'].create( + {'warning': warning_message}) + return { + 'name': 'Overlapping Dates Warning', + 'type': 'ir.actions.act_window', + 'res_model': 'overlapping.date', + 'res_id': warning.id, + 'view_mode': 'form', + 'view_id': self.env.ref( + 'hr_holiday_generator.overlapping_date_view_form').id, + 'target': 'new', + } + else: + self.env['resource.calendar.leaves'].create([{ + 'name': holiday.name, + 'date_from': holiday.start_date, + 'date_to': holiday.end_date + } for holiday in self.calender_leaves_ids]) diff --git a/hr_holiday_generator/wizard/hr_holiday_generator_views.xml b/hr_holiday_generator/wizard/hr_holiday_generator_views.xml new file mode 100755 index 000000000..4679d67f8 --- /dev/null +++ b/hr_holiday_generator/wizard/hr_holiday_generator_views.xml @@ -0,0 +1,66 @@ + + + + + hr.holiday.generator.view.form + hr.holiday.generator + +
+ + + + + + + +