diff --git a/hr_attendance_xlsx_report/README.rst b/hr_attendance_xlsx_report/README.rst new file mode 100644 index 000000000..211505aac --- /dev/null +++ b/hr_attendance_xlsx_report/README.rst @@ -0,0 +1,36 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Employee Attendance Xlsx Report +=============================== +This module helps to manage the attendance report of employees in xlsx. + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: Yadhu Krishnan @cybrosys, 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 `Our Website `__ + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/hr_attendance_xlsx_report/__init__.py b/hr_attendance_xlsx_report/__init__.py new file mode 100644 index 000000000..13804b581 --- /dev/null +++ b/hr_attendance_xlsx_report/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: YADHU KRISHNAN(odoo@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 . +# +################################################################################ +from . import controllers +from . import wizard + diff --git a/hr_attendance_xlsx_report/__manifest__.py b/hr_attendance_xlsx_report/__manifest__.py new file mode 100644 index 000000000..c293c4d19 --- /dev/null +++ b/hr_attendance_xlsx_report/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: YADHU KRISHNAN(odoo@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 . +# +################################################################################ +{ + 'name': "Employee Attendance Xlsx Report", + 'version': '17.0.1.0.0', + 'category': 'Human Resources', + 'summary': """This module will manage the attendance report of employees + in xlsx""", + 'description': """This module helps to generate the attendance report of + employees in the XLSX format""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['hr_attendance'], + 'data': [ + 'security/ir.model.access.csv', + 'wizard/employee_attendance_report_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'hr_attendance_xlsx_report/static/src/js/action_manager.js', + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False +} diff --git a/hr_attendance_xlsx_report/controllers/__init__.py b/hr_attendance_xlsx_report/controllers/__init__.py new file mode 100644 index 000000000..b43c6334d --- /dev/null +++ b/hr_attendance_xlsx_report/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: YADHU KRISHNAN(odoo@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 . +# +################################################################################ +from . import hr_attendance_xlsx_report diff --git a/hr_attendance_xlsx_report/controllers/hr_attendance_xlsx_report.py b/hr_attendance_xlsx_report/controllers/hr_attendance_xlsx_report.py new file mode 100644 index 000000000..28c25eaa4 --- /dev/null +++ b/hr_attendance_xlsx_report/controllers/hr_attendance_xlsx_report.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: YADHU KRISHNAN(odoo@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 . +# +################################################################################ +import json +from odoo import http +from odoo.http import content_disposition, request, serialize_exception +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + """Xlsx Report controller""" + @http.route('/xlsx_reports', type='http', auth='user', methods=['POST'], + csrf=False) + def get_report_xlsx(self, model, options, output_format, report_name): + """xlsx report""" + report_obj = request.env[model].with_user(request.session.uid) + options = json.loads(options) + token = 'dummy-because-api-expects-one' + try: + if output_format == 'xlsx': + response = request.make_response( + None, + headers=[ + ('Content-Type', 'application/vnd.ms-excel'), + ('Content-Disposition', content_disposition(report_name + '.xlsx')) + ] + ) + report_obj.get_xlsx_report(options, response) + response.set_cookie('fileToken', token) + return response + except Exception as e: + se = serialize_exception(e) + error = { + 'code': 200, + 'message': 'Odoo Server Error', + 'data': se + } + return request.make_response(html_escape(json.dumps(error))) diff --git a/hr_attendance_xlsx_report/doc/RELEASE_NOTES.md b/hr_attendance_xlsx_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..562afd4c6 --- /dev/null +++ b/hr_attendance_xlsx_report/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 25.03.2024 +#### Version 17.0.1.0.0 +#### ADD + +- Initial commit for Employee Attendance Xlsx Report diff --git a/hr_attendance_xlsx_report/security/ir.model.access.csv b/hr_attendance_xlsx_report/security/ir.model.access.csv new file mode 100644 index 000000000..5d2d406a3 --- /dev/null +++ b/hr_attendance_xlsx_report/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_employee_attendance_report,access.employee.attendance.report,model_employee_attendance_report,base.group_user,1,1,1,1 + diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/check.png b/hr_attendance_xlsx_report/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/check.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/chevron.png b/hr_attendance_xlsx_report/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/chevron.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/cogs.png b/hr_attendance_xlsx_report/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/cogs.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/consultation.png b/hr_attendance_xlsx_report/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/consultation.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/ecom-black.png b/hr_attendance_xlsx_report/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/ecom-black.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/education-black.png b/hr_attendance_xlsx_report/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/education-black.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/hotel-black.png b/hr_attendance_xlsx_report/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/hotel-black.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/license.png b/hr_attendance_xlsx_report/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/license.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/lifebuoy.png b/hr_attendance_xlsx_report/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/lifebuoy.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/manufacturing-black.png b/hr_attendance_xlsx_report/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/manufacturing-black.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/pos-black.png b/hr_attendance_xlsx_report/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/pos-black.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/puzzle.png b/hr_attendance_xlsx_report/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/puzzle.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/restaurant-black.png b/hr_attendance_xlsx_report/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/restaurant-black.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/service-black.png b/hr_attendance_xlsx_report/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/service-black.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/trading-black.png b/hr_attendance_xlsx_report/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/trading-black.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/training.png b/hr_attendance_xlsx_report/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/training.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/update.png b/hr_attendance_xlsx_report/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/update.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/user.png b/hr_attendance_xlsx_report/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/user.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/icons/wrench.png b/hr_attendance_xlsx_report/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/icons/wrench.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/Cybrosys R.png b/hr_attendance_xlsx_report/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/Cybrosys R.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/categories.png b/hr_attendance_xlsx_report/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/categories.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/check-box.png b/hr_attendance_xlsx_report/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/check-box.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/compass.png b/hr_attendance_xlsx_report/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/compass.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/corporate.png b/hr_attendance_xlsx_report/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/corporate.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/customer-support.png b/hr_attendance_xlsx_report/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/customer-support.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/cybrosys-logo.png b/hr_attendance_xlsx_report/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/cybrosys-logo.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/features.png b/hr_attendance_xlsx_report/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/features.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/logo.png b/hr_attendance_xlsx_report/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/logo.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/pictures.png b/hr_attendance_xlsx_report/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/pictures.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/pie-chart.png b/hr_attendance_xlsx_report/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/pie-chart.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/right-arrow.png b/hr_attendance_xlsx_report/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/right-arrow.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/star.png b/hr_attendance_xlsx_report/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/star.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/support.png b/hr_attendance_xlsx_report/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/support.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/misc/whatsapp.png b/hr_attendance_xlsx_report/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/misc/whatsapp.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/modules/l1.png b/hr_attendance_xlsx_report/static/description/assets/modules/l1.png new file mode 100644 index 000000000..ed175b076 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/modules/l1.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/modules/l2.png b/hr_attendance_xlsx_report/static/description/assets/modules/l2.png new file mode 100644 index 000000000..a3194264c Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/modules/l2.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/modules/l3.png b/hr_attendance_xlsx_report/static/description/assets/modules/l3.png new file mode 100644 index 000000000..e894393ef Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/modules/l3.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/modules/l4.png b/hr_attendance_xlsx_report/static/description/assets/modules/l4.png new file mode 100644 index 000000000..f3c986fc1 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/modules/l4.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/modules/l5.png b/hr_attendance_xlsx_report/static/description/assets/modules/l5.png new file mode 100644 index 000000000..b21837312 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/modules/l5.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/modules/l6.png b/hr_attendance_xlsx_report/static/description/assets/modules/l6.png new file mode 100644 index 000000000..e64a5b55c Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/modules/l6.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/screenshots/hero-v17.gif b/hr_attendance_xlsx_report/static/description/assets/screenshots/hero-v17.gif new file mode 100644 index 000000000..07c61cf49 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/screenshots/hero-v17.gif differ diff --git a/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx1.png b/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx1.png new file mode 100644 index 000000000..2dc148fb9 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx1.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx2.png b/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx2.png new file mode 100644 index 000000000..c84d216d8 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx2.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx3.png b/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx3.png new file mode 100644 index 000000000..516ee5bee Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx3.png differ diff --git a/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx4.png b/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx4.png new file mode 100644 index 000000000..748488383 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/assets/screenshots/xlsx4.png differ diff --git a/hr_attendance_xlsx_report/static/description/banner.jpg b/hr_attendance_xlsx_report/static/description/banner.jpg new file mode 100644 index 000000000..9067c223a Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/banner.jpg differ diff --git a/hr_attendance_xlsx_report/static/description/icon.png b/hr_attendance_xlsx_report/static/description/icon.png new file mode 100644 index 000000000..6edf27aa0 Binary files /dev/null and b/hr_attendance_xlsx_report/static/description/icon.png differ diff --git a/hr_attendance_xlsx_report/static/description/index.html b/hr_attendance_xlsx_report/static/description/index.html new file mode 100644 index 000000000..7593d9b97 --- /dev/null +++ b/hr_attendance_xlsx_report/static/description/index.html @@ -0,0 +1,669 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Employee Attendance Xlsx Report

+

+ This module helps to manage the attendance report of employees

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Attendance report of all employees.

+
+
+
+
+
+
+ +
+
+

Attendance report of one specific employee

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

+ Choose date range from wizard.

+

+ Go to Attendance -> Reports -> Attendance Report

+
+
+ +
+
+
+
+
+
+

+ Attendance report of all employees

+
+
+ +
+
+
+ +
+
+
+

Choose date range and employee from wizard

+
+
+ +
+
+
+
+
+
+

Attendance report of a chosen employee with a specified date range

+
+
+ +
+
+
+
+
+
+
    +
  • + Attendance report of all employees +
  • +
  • + Attendance report of one specific employee +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:19 Feb 2024 +
+

+ Initial Commit for Employee Attendance Xlsx Report

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/hr_attendance_xlsx_report/static/src/js/action_manager.js b/hr_attendance_xlsx_report/static/src/js/action_manager.js new file mode 100644 index 000000000..216b1cc3b --- /dev/null +++ b/hr_attendance_xlsx_report/static/src/js/action_manager.js @@ -0,0 +1,25 @@ +/** @odoo-module **/ +import { registry } from "@web/core/registry"; +import { BlockUI } from "@web/core/ui/block_ui"; +import { download } from "@web/core/network/download"; + +/** +XLSX Handler +This handler is responsible for generating XLSX reports. +It sends a request to the server to generate the report in XLSX format +and downloads the generated file. +@param {Object} action - The action object containing the report details. +@returns {Promise} - A promise that resolves when the report generation is complete. +*/ +registry.category("ir.actions.report handlers").add("xlsx", async function (action) { + if (action.report_type === 'xlsx') { + BlockUI; + await download({ + url: '/xlsx_reports', + data: action.data, + complete: () => unblockUI, + error: (error) => self.call('crash_manager', 'rpc_error', error), + }); + + } +}); \ No newline at end of file diff --git a/hr_attendance_xlsx_report/wizard/__init__.py b/hr_attendance_xlsx_report/wizard/__init__.py new file mode 100644 index 000000000..4a11ea6b7 --- /dev/null +++ b/hr_attendance_xlsx_report/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: YADHU KRISHNAN(odoo@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 . +# +################################################################################ +from . import employee_attendance_report diff --git a/hr_attendance_xlsx_report/wizard/employee_attendance_report.py b/hr_attendance_xlsx_report/wizard/employee_attendance_report.py new file mode 100644 index 000000000..00b09f471 --- /dev/null +++ b/hr_attendance_xlsx_report/wizard/employee_attendance_report.py @@ -0,0 +1,183 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: YADHU KRISHNAN(odoo@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 . +# +################################################################################ +import io +import json +from datetime import datetime, date +from dateutil.rrule import rrule, DAILY + +from odoo import fields, models, _ +from odoo.exceptions import ValidationError +from odoo.tools import date_utils + +try: + from odoo.tools.misc import xlsxwriter +except ImportError: + import xlsxwriter + + +class EmployeeAttendanceReport(models.TransientModel): + """ Wizard for Employee Attendance Report """ + _name = 'employee.attendance.report' + _description = 'Employee Attendance Report Wizard' + + from_date = fields.Date('From Date', help="Starting date for report") + to_date = fields.Date('To Date', help="Ending date for report") + employee_ids = fields.Many2many('hr.employee', string='Employee', + help='Name of Employee') + + def action_print_xlsx(self): + """ + Returns report action for the XLSX Attendance report + Raises: ValidationError: if From Date > To Date + Raises: ValidationError: if there is no attendance records + Returns: + dict: the XLSX report action + """ + if not self.from_date: + self.from_date = date.today() + if not self.to_date: + self.to_date = date.today() + if self.from_date > self.to_date: + raise ValidationError(_('From Date must be earlier than To Date.')) + attendances = self.env['hr.attendance'].search( + [('employee_id', 'in', self.employee_ids.ids)]) + data = { + 'from_date': self.from_date, + 'to_date': self.to_date, + 'employee_ids': self.employee_ids.ids + } + if self.employee_ids and not attendances: + raise ValidationError( + _("There is no attendance records for the employee")) + if self.from_date and self.to_date: + return { + 'type': 'ir.actions.report', + 'data': {'model': 'employee.attendance.report', + 'options': json.dumps( + data, default=date_utils.json_default), + 'output_format': 'xlsx', + 'report_name': 'Attendance Report', + }, + 'report_type': 'xlsx', + } + + def get_xlsx_report(self, data, response): + """ + Print the XLSX report + Returns: None + """ + query = """select hr_e.name,date(hr_at.check_in), + SUM(hr_at.worked_hours) from hr_attendance hr_at LEFT JOIN + hr_employee hr_e ON hr_at.employee_id = hr_e.id""" + + if not data['employee_ids']: + query += """ GROUP BY date(check_in), hr_e.name""" + + else: + query += """ WHERE hr_e.id in (%s) GROUP BY date(check_in), + hr_e.name""" % (', '.join(str(employee_id) + for employee_id in data['employee_ids'])) + self.env.cr.execute(query) + docs = self.env.cr.dictfetchall() + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet('docs') + start_date = datetime.strptime(data['from_date'], '%Y-%m-%d').date() + end_date = datetime.strptime(data['to_date'], '%Y-%m-%d').date() + date_range = rrule(DAILY, dtstart=start_date, until=end_date) + sheet.set_column(1, 1, 15) + sheet.set_column(2, 2, 15) + border = workbook.add_format({'border': 1}) + green = workbook.add_format({'bg_color': '#28A828', 'border': 1}) + red = workbook.add_format({'bg_color': '#ff3333', 'border': 1}) + rose = workbook.add_format({'bg_color': '#DA70D6', 'border': 1}) + head = workbook.add_format( + {'bold': True, 'font_size': 30, 'align': 'center'}) + date_size = workbook.add_format( + {'font_size': 12, 'bold': True, 'align': 'center'}) + sheet.merge_range('C3:K6', 'Attendance Report', head) + sheet.merge_range('B8:C9', 'From Date: ' + data['from_date'], date_size) + sheet.merge_range('B10:C11', 'To Date: ' + data['to_date'], date_size) + sheet.write(2, 12, '', green) + sheet.write(2, 13, 'Present') + sheet.write(4, 12, '', red) + sheet.write(4, 13, 'Absent') + sheet.write(6, 12, '', rose) + sheet.write(6, 13, 'Half Day') + sheet.merge_range('B16:B17', 'Sl.No', border) + sheet.merge_range('C16:C17', 'Employee', border) + row = 15 + col = 2 + for date_data in date_range: + col += 1 + sheet.write(row, col, date_data.strftime('%Y-%m-%d'), border) + row = 16 + col = 2 + for date_data in date_range: + col += 1 + sheet.write(row, col, date_data.strftime('%a'), border) + employee_names = [] + attendance_list = [] + for doc in docs: + if doc['name'] not in employee_names: + date_sum_list = [] + employee_names.append(doc['name']) + for date_data in date_range: + date_out = date_data.strftime('%Y-%m-%d') + record_list = list( + filter( + lambda x: x['name'] == doc['name'] and x[ + 'date'].strftime( + '%Y-%m-%d') == date_out, docs)) + if record_list: + date_sum_list.append(record_list[0]) + else: + date_sum_list.append({ + 'name': '', + 'date': '', + 'sum': 0 + }) + attendance_list.append( + {'name': doc['name'], 'items': date_sum_list}) + work = self.env.ref('resource.resource_calendar_std') + row = 17 + i = 0 + for rec in attendance_list: + row += 1 + col = 1 + i += 1 + sheet.write(row, col, i, border) + col += 1 + sheet.write(row, col, rec['name'], border) + for item in rec['items']: + col += 1 + if item['sum'] >= work.hours_per_day: + sheet.write(row, col, item['sum'], green) + elif 1 <= item['sum'] <= 4 or 4 <= item['sum'] <= \ + work.hours_per_day: + sheet.write(row, col, item['sum'], rose) + else: + sheet.write(row, col, item['sum'], red) + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() diff --git a/hr_attendance_xlsx_report/wizard/employee_attendance_report_views.xml b/hr_attendance_xlsx_report/wizard/employee_attendance_report_views.xml new file mode 100644 index 000000000..bd20a4943 --- /dev/null +++ b/hr_attendance_xlsx_report/wizard/employee_attendance_report_views.xml @@ -0,0 +1,46 @@ + + + + + employee.attendance.report.view.form + employee.attendance.report + +
+ + + + + + + + + +
+
+
+
+
+ + + Attendance Report + ir.actions.act_window + employee.attendance.report + form + + new + + + + + +
\ No newline at end of file