From 49dbfc0fceade4d2a6d50eb697a0bc614ab7f6df Mon Sep 17 00:00:00 2001
From: RisvanaCybro
Date: Thu, 28 Dec 2023 14:00:56 +0530
Subject: [PATCH] Dec 28 : [ADD] Initial Commit 'hr_payslip_monthly_report'
---
hr_payslip_monthly_report/README.rst | 56 ++
hr_payslip_monthly_report/__init__.py | 24 +
hr_payslip_monthly_report/__manifest__.py | 49 ++
.../data/mail_template_data.xml | 21 +
.../doc/RELEASE_NOTES.md | 5 +
hr_payslip_monthly_report/models/__init__.py | 23 +
.../models/hr_payslip.py | 87 +++
.../models/res_config_settings.py | 51 ++
hr_payslip_monthly_report/report/__init__.py | 22 +
.../report/hr_payslip_report.py | 160 ++++
.../report/hr_payslip_report_views.xml | 88 +++
.../security/ir.model.access.csv | 3 +
.../description/assets/icons/capture (1).png | Bin 0 -> 36623 bytes
.../static/description/assets/icons/check.png | Bin 0 -> 3676 bytes
.../description/assets/icons/chevron.png | Bin 0 -> 310 bytes
.../static/description/assets/icons/cogs.png | Bin 0 -> 1377 bytes
.../description/assets/icons/consultation.png | Bin 0 -> 1458 bytes
.../description/assets/icons/ecom-black.png | Bin 0 -> 576 bytes
.../assets/icons/education-black.png | Bin 0 -> 733 bytes
.../description/assets/icons/hotel-black.png | Bin 0 -> 911 bytes
.../static/description/assets/icons/img.png | Bin 0 -> 1173 bytes
.../description/assets/icons/license.png | Bin 0 -> 1095 bytes
.../description/assets/icons/lifebuoy.png | Bin 0 -> 1199 bytes
.../assets/icons/manufacturing-black.png | Bin 0 -> 673 bytes
.../assets/icons/photo-capture.png | Bin 0 -> 10898 bytes
.../description/assets/icons/pos-black.png | Bin 0 -> 878 bytes
.../description/assets/icons/puzzle.png | Bin 0 -> 653 bytes
.../assets/icons/restaurant-black.png | Bin 0 -> 905 bytes
.../assets/icons/service-black.png | Bin 0 -> 839 bytes
.../assets/icons/trading-black.png | Bin 0 -> 427 bytes
.../description/assets/icons/training.png | Bin 0 -> 627 bytes
.../description/assets/icons/update.png | Bin 0 -> 1225 bytes
.../static/description/assets/icons/user.png | Bin 0 -> 988 bytes
.../description/assets/icons/wrench.png | Bin 0 -> 1205 bytes
.../description/assets/misc/Cybrosys R.png | Bin 0 -> 82191 bytes
.../static/description/assets/misc/email.svg | 33 +
.../static/description/assets/misc/phone.svg | 3 +
.../description/assets/misc/star (1) 2.svg | 9 +
.../description/assets/misc/support (1) 1.svg | 9 +
.../description/assets/misc/support-email.svg | 6 +
.../description/assets/misc/tick-mark.svg | 17 +
.../description/assets/misc/whatsapp 1.svg | 9 +
.../description/assets/misc/whatsapp.svg | 33 +
.../static/description/assets/modules/1.gif | Bin 0 -> 1336986 bytes
.../static/description/assets/modules/2.jpg | Bin 0 -> 89001 bytes
.../static/description/assets/modules/3.jpg | Bin 0 -> 88546 bytes
.../static/description/assets/modules/4.jpg | Bin 0 -> 120117 bytes
.../static/description/assets/modules/5.jpg | Bin 0 -> 101865 bytes
.../static/description/assets/modules/6.jpg | Bin 0 -> 97065 bytes
.../description/assets/screenshots/1.png | Bin 0 -> 139417 bytes
.../description/assets/screenshots/2.png | Bin 0 -> 62161 bytes
.../description/assets/screenshots/3.png | Bin 0 -> 45867 bytes
.../description/assets/screenshots/4.png | Bin 0 -> 61650 bytes
.../description/assets/screenshots/hero.gif | Bin 0 -> 121496 bytes
.../static/description/banner.jpg | Bin 0 -> 87433 bytes
.../static/description/icon.png | Bin 0 -> 14003 bytes
.../static/description/index.html | 706 ++++++++++++++++++
.../views/hr_payslip_views.xml | 19 +
.../views/res_config_settings_views.xml | 33 +
hr_payslip_monthly_report/wizard/__init__.py | 22 +
.../wizard/payslip_confirm.py | 39 +
.../wizard/payslip_confirm_views.xml | 33 +
62 files changed, 1560 insertions(+)
create mode 100644 hr_payslip_monthly_report/README.rst
create mode 100644 hr_payslip_monthly_report/__init__.py
create mode 100644 hr_payslip_monthly_report/__manifest__.py
create mode 100644 hr_payslip_monthly_report/data/mail_template_data.xml
create mode 100644 hr_payslip_monthly_report/doc/RELEASE_NOTES.md
create mode 100644 hr_payslip_monthly_report/models/__init__.py
create mode 100644 hr_payslip_monthly_report/models/hr_payslip.py
create mode 100644 hr_payslip_monthly_report/models/res_config_settings.py
create mode 100644 hr_payslip_monthly_report/report/__init__.py
create mode 100644 hr_payslip_monthly_report/report/hr_payslip_report.py
create mode 100644 hr_payslip_monthly_report/report/hr_payslip_report_views.xml
create mode 100644 hr_payslip_monthly_report/security/ir.model.access.csv
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/capture (1).png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/check.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/chevron.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/cogs.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/consultation.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/ecom-black.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/education-black.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/hotel-black.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/img.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/license.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/lifebuoy.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/manufacturing-black.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/photo-capture.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/pos-black.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/puzzle.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/restaurant-black.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/service-black.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/trading-black.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/training.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/update.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/user.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/icons/wrench.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/misc/Cybrosys R.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/misc/email.svg
create mode 100644 hr_payslip_monthly_report/static/description/assets/misc/phone.svg
create mode 100644 hr_payslip_monthly_report/static/description/assets/misc/star (1) 2.svg
create mode 100644 hr_payslip_monthly_report/static/description/assets/misc/support (1) 1.svg
create mode 100644 hr_payslip_monthly_report/static/description/assets/misc/support-email.svg
create mode 100644 hr_payslip_monthly_report/static/description/assets/misc/tick-mark.svg
create mode 100644 hr_payslip_monthly_report/static/description/assets/misc/whatsapp 1.svg
create mode 100644 hr_payslip_monthly_report/static/description/assets/misc/whatsapp.svg
create mode 100644 hr_payslip_monthly_report/static/description/assets/modules/1.gif
create mode 100644 hr_payslip_monthly_report/static/description/assets/modules/2.jpg
create mode 100644 hr_payslip_monthly_report/static/description/assets/modules/3.jpg
create mode 100644 hr_payslip_monthly_report/static/description/assets/modules/4.jpg
create mode 100644 hr_payslip_monthly_report/static/description/assets/modules/5.jpg
create mode 100644 hr_payslip_monthly_report/static/description/assets/modules/6.jpg
create mode 100644 hr_payslip_monthly_report/static/description/assets/screenshots/1.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/screenshots/2.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/screenshots/3.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/screenshots/4.png
create mode 100644 hr_payslip_monthly_report/static/description/assets/screenshots/hero.gif
create mode 100644 hr_payslip_monthly_report/static/description/banner.jpg
create mode 100644 hr_payslip_monthly_report/static/description/icon.png
create mode 100644 hr_payslip_monthly_report/static/description/index.html
create mode 100644 hr_payslip_monthly_report/views/hr_payslip_views.xml
create mode 100644 hr_payslip_monthly_report/views/res_config_settings_views.xml
create mode 100644 hr_payslip_monthly_report/wizard/__init__.py
create mode 100644 hr_payslip_monthly_report/wizard/payslip_confirm.py
create mode 100644 hr_payslip_monthly_report/wizard/payslip_confirm_views.xml
diff --git a/hr_payslip_monthly_report/README.rst b/hr_payslip_monthly_report/README.rst
new file mode 100644
index 000000000..5ca75a5ec
--- /dev/null
+++ b/hr_payslip_monthly_report/README.rst
@@ -0,0 +1,56 @@
+.. 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
+
+Payroll Advanced Features
+=========================
+* Payroll Advanced Features for Odoo 17 community edition
+
+Features
+========
+* Payroll-Payslip Reporting.
+* Automatic Mail During Confirmation of Payslip.
+* Mass Confirm Payslip.
+
+Configuration
+=============
+Nothing to configure.
+
+License
+-------
+Affero General Public License, v3.0 (AGPL v3).
+(https://www.gnu.org/licenses/lgpl-3.0-standalone.html)
+
+Company
+-------
+* `Cybrosys Techno Solutions `__
+
+Credits
+-------
+* Developers: (V14) Jibin James
+ (V15) Aneesh,
+ (V16) Anusha,
+ (V17) Farhana Jahan PT,
+ 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: ``__
diff --git a/hr_payslip_monthly_report/__init__.py b/hr_payslip_monthly_report/__init__.py
new file mode 100644
index 000000000..d8660a2df
--- /dev/null
+++ b/hr_payslip_monthly_report/__init__.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2023-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions (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 report
+from . import wizard
diff --git a/hr_payslip_monthly_report/__manifest__.py b/hr_payslip_monthly_report/__manifest__.py
new file mode 100644
index 000000000..9e9d7c891
--- /dev/null
+++ b/hr_payslip_monthly_report/__manifest__.py
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2023-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions (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': 'Payroll Advanced Features',
+ 'summary': 'Payroll Advanced Features For Odoo 17 Community.',
+ 'description': 'Payroll Advanced Features For Odoo 17 Community,'
+ 'Payroll-Payslip Reporting, Automatic Mail During '
+ 'Confirmation of Payslip, Mass Confirm Payslip ',
+ 'category': 'Generic Modules/Human Resources',
+ 'author': 'Cybrosys Techno Solutions',
+ 'company': 'Cybrosys Techno Solutions',
+ 'maintainer': 'Cybrosys Techno Solutions',
+ 'website': 'https://www.cybrosys.com',
+ 'depends': [
+ 'hr_payroll_community', 'mail',
+ ],
+ 'data': [
+ 'security/ir.model.access.csv',
+ 'views/hr_payslip_views.xml',
+ 'views/res_config_settings_views.xml',
+ 'data/mail_template_data.xml',
+ 'wizard/payslip_confirm_views.xml',
+ 'report/hr_payslip_report_views.xml',
+ ],
+ 'images': ['static/description/banner.jpg'],
+ 'license': 'LGPL-3',
+ 'installable': True,
+ 'auto_install': False,
+ 'application': False,
+}
diff --git a/hr_payslip_monthly_report/data/mail_template_data.xml b/hr_payslip_monthly_report/data/mail_template_data.xml
new file mode 100644
index 000000000..23f1a1bb2
--- /dev/null
+++ b/hr_payslip_monthly_report/data/mail_template_data.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Monthly Payslip Email
+
+ {{(user.email)}}
+ {{object.employee_id.private_email}}
+ Ref {{object.number}}
+
+ Hi,
+ Here by attaching payslip details of this month
+ ]]>
+
+
+ {{(object.number or '').replace('/','_')}}
+
+
+
\ No newline at end of file
diff --git a/hr_payslip_monthly_report/doc/RELEASE_NOTES.md b/hr_payslip_monthly_report/doc/RELEASE_NOTES.md
new file mode 100644
index 000000000..174f73ee7
--- /dev/null
+++ b/hr_payslip_monthly_report/doc/RELEASE_NOTES.md
@@ -0,0 +1,5 @@
+## Module
+#### 18.12.2023
+#### Version 17.0.1.0.0
+#### ADD
+- Initial commit for Payroll Advanced Features
diff --git a/hr_payslip_monthly_report/models/__init__.py b/hr_payslip_monthly_report/models/__init__.py
new file mode 100644
index 000000000..4452a8fdd
--- /dev/null
+++ b/hr_payslip_monthly_report/models/__init__.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2023-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions (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 hr_payslip
+from . import res_config_settings
diff --git a/hr_payslip_monthly_report/models/hr_payslip.py b/hr_payslip_monthly_report/models/hr_payslip.py
new file mode 100644
index 000000000..51fd2bc76
--- /dev/null
+++ b/hr_payslip_monthly_report/models/hr_payslip.py
@@ -0,0 +1,87 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2023-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions (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 logging
+
+from odoo import fields, models, _
+
+_logger = logging.getLogger(__name__)
+
+
+class HrPayslip(models.Model):
+ """Inherit hr_payslip module for sending a mail."""
+ _inherit = 'hr.payslip'
+
+ is_send_mail = fields.Boolean(
+ string="Is Send Mail",
+ help="Checks the Mail is send or not")
+
+ def action_payslip_done(self):
+ """Checking auto email option is set. If set email containing payslip
+ details will send on confirmation"""
+ if self.env['ir.config_parameter'].sudo().get_param(
+ 'send_payslip_by_email'):
+ self.write({'is_send_mail': True})
+ res = super(HrPayslip, self).action_payslip_done()
+ if self.env['ir.config_parameter'].sudo().get_param(
+ 'send_payslip_by_email'):
+ for payslip in self:
+ if payslip.employee_id.private_email:
+ template = self.env.ref(
+ 'hr_payslip_monthly_report.email_template_payslip')
+ template.sudo().send_mail(payslip.id, force_send=True)
+ _logger.info("Payslip details for %s send by mail",
+ payslip.employee_id.name)
+ return res
+
+ def action_payslip_send(self):
+ """Opens a window to compose an email,
+ with template message loaded by default"""
+ self.ensure_one()
+ self.write({'is_send_mail': True})
+ ir_model_data = self.env['ir.model.data']
+ try:
+ template_id = ir_model_data._xmlid_lookup(
+ 'hr_payslip_monthly_report.email_template_payslip')[1]
+ except ValueError:
+ template_id = False
+ try:
+ compose_form_id = ir_model_data._xmlid_lookup(
+ 'mail.email_compose_message_wizard_form')[1]
+ except ValueError:
+ compose_form_id = False
+ ctx = {
+ 'default_model': 'hr.payslip',
+ 'default_res_ids': self.ids,
+ 'default_template_id': template_id,
+ 'default_composition_mode': 'comment',
+ 'force_email': True,
+ }
+ return {
+ 'name': _('Compose Email'),
+ 'type': 'ir.actions.act_window',
+ 'view_mode': 'form',
+ 'res_model': 'mail.compose.message',
+ 'views': [(compose_form_id, 'form')],
+ 'view_id': compose_form_id,
+ 'target': 'new',
+ 'context': ctx,
+ }
diff --git a/hr_payslip_monthly_report/models/res_config_settings.py b/hr_payslip_monthly_report/models/res_config_settings.py
new file mode 100644
index 000000000..0cfb7bb00
--- /dev/null
+++ b/hr_payslip_monthly_report/models/res_config_settings.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2023-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions (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 ResConfigSettings(models.TransientModel):
+ """Inherit res_config_settings for adding a boolean for send
+ Payslip by Mail"""
+ _inherit = 'res.config.settings'
+
+ send_payslip_by_email = fields.Boolean(
+ string="Automatic Send Payslip By Mail",
+ help="Is needed for automatic send mail")
+
+ @api.model
+ def get_values(self):
+ """Function for getting boolean"""
+ res = super(ResConfigSettings, self).get_values()
+ params = self.env['ir.config_parameter'].sudo()
+ send_payslip_by_email = params.get_param('send_payslip_by_email',
+ default=False)
+ res.update(
+ send_payslip_by_email=send_payslip_by_email
+ )
+ return res
+
+ def set_values(self):
+ """Function for setting boolean"""
+ super(ResConfigSettings, self).set_values()
+ self.env['ir.config_parameter'].sudo().set_param(
+ "send_payslip_by_email",
+ self.send_payslip_by_email)
diff --git a/hr_payslip_monthly_report/report/__init__.py b/hr_payslip_monthly_report/report/__init__.py
new file mode 100644
index 000000000..9c6a4edf9
--- /dev/null
+++ b/hr_payslip_monthly_report/report/__init__.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2023-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions (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 hr_payslip_report
diff --git a/hr_payslip_monthly_report/report/hr_payslip_report.py b/hr_payslip_monthly_report/report/hr_payslip_report.py
new file mode 100644
index 000000000..e413c5dd2
--- /dev/null
+++ b/hr_payslip_monthly_report/report/hr_payslip_report.py
@@ -0,0 +1,160 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2023-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions (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 time
+from calendar import monthrange
+from datetime import date
+
+from odoo import fields, models, tools
+
+
+class HrPayrollReportView(models.Model):
+ """Create a new model for getting monthly report"""
+ _name = 'hr.payroll.report'
+ _auto = False
+
+ now = date.today()
+ month_day = monthrange(now.year, now.month)
+ start_date = fields.Date(string="Start Date",
+ default=time.strftime('%Y-%m-01'), invisible=True,
+ help="Start Date for Report")
+ end_date = fields.Date(string="End Date", default=time.strftime(
+ '%Y-%m-' + str(month_day[1]) + ''), invisible=True,
+ help="End Date for Report")
+ name = fields.Many2one('hr.employee', string='Employee',
+ help="Choose Employee")
+ date_from = fields.Date(string='From', help="Starting Date for Report")
+ date_to = fields.Date(string='To', help="Ending Date for Report")
+ state = fields.Selection(
+ [('draft', 'Draft'), ('verify', 'Waiting'), ('done', 'Done'),
+ ('cancel', 'Rejected')],
+ string='Status', help="Select Status for Report")
+ job_id = fields.Many2one('hr.job', string='Job Title',
+ help="Choose Hr Job")
+ company_id = fields.Many2one('res.company', string='Company',
+ help="Choose Company")
+ department_id = fields.Many2one('hr.department',
+ string='Department',
+ help="Choose Hr Department")
+ rule_name = fields.Many2one('hr.salary.rule.category',
+ string="Rule Category",
+ help="Choose Salary Rule Category")
+ rule_amount = fields.Float(string="Amount", help="Set Amount")
+ struct_id = fields.Many2one('hr.payroll.structure',
+ string="Salary Structure",
+ help="Choose Hr Payroll Structure")
+ rule_id = fields.Many2one('hr.salary.rule',
+ string="Salary Rule", help="Choose Salary Rule")
+
+ def _select(self):
+ """
+ Generate and return a SQL SELECT statement for retrieving specific fields from the database.
+ Returns:
+ str: SQL SELECT statement with the following fields:
+ - Minimum of psl.id
+ - ps.id
+ - ps.number
+ - emp.id as name
+ - dp.id as department_id
+ - jb.id as job_id
+ - cmp.id as company_id
+ - ps.date_from
+ - ps.date_to
+ - ps.state as state
+ - rl.id as rule_name
+ - psl.total as rule_amount
+ - ps.struct_id as struct_id
+ - rlu.id as rule_id
+ """
+ select_str = """
+ min(psl.id),ps.id,ps.number,emp.id as name,dp.id as
+ department_id,jb.id as job_id,cmp.id as company_id,ps.date_from,
+ ps.date_to, ps.state as state ,rl.id as rule_name,
+ psl.total as rule_amount,ps.struct_id as struct_id,rlu.id as rule_id
+ """
+ return select_str
+
+ def _from(self):
+ """
+ Generate and return a SQL FROM clause for joining tables in a
+ database query.
+
+ Returns:
+ str: SQL FROM clause with the following table joins:
+ - hr_payslip_line (psl)
+ - hr_payslip (ps) on ps.id = psl.slip_id
+ - hr_salary_rule (rlu) on rlu.id = psl.salary_rule_id
+ - hr_employee (emp) on ps.employee_id = emp.id
+ - hr_salary_rule_category (rl) on rl.id = psl.category_id
+ - hr_department (dp) (left join) on emp.department_id = dp.id
+ - hr_job (jb) (left join) on emp.job_id = jb.id
+ - res_company (cmp) on cmp.id = ps.company_id
+ """
+ from_str = """
+ hr_payslip_line psl
+ join hr_payslip ps on ps.id=psl.slip_id
+ join hr_salary_rule rlu on rlu.id = psl.salary_rule_id
+ join hr_employee emp on ps.employee_id=emp.id
+ join hr_salary_rule_category rl on rl.id = psl.category_id
+ left join hr_department dp on emp.department_id=dp.id
+ left join hr_job jb on emp.job_id=jb.id
+ join res_company cmp on cmp.id=ps.company_id
+ """
+ return from_str
+
+ def _group_by(self):
+ """
+ Generate and return a SQL GROUP BY clause for grouping results in a
+ database query.
+
+ Returns:
+ str: SQL GROUP BY clause with the following fields:
+ - ps.number
+ - ps.id
+ - emp.id
+ - dp.id
+ - jb.id
+ - cmp.id
+ - ps.date_from
+ - ps.date_to
+ - ps.state
+ - psl.total
+ - psl.name
+ - psl.category_id
+ - rl.id
+ - rlu.id
+ """
+ group_by_str = """group by ps.number,ps.id,emp.id,dp.id,jb.id,cmp.id,
+ ps.date_from,ps.date_to,ps.state,
+ psl.total,psl.name,psl.category_id,rl.id,rlu.id"""
+ return group_by_str
+
+ def init(self):
+ """
+ Initialize or update a database view with a SELECT statement.
+ """
+ tools.drop_view_if_exists(self.env.cr, self._table)
+ self.env.cr.execute("""CREATE or REPLACE VIEW %s as ( SELECT
+ %s
+ FROM %s
+ %s
+ )""" % (
+ self._table, self._select(), self._from(), self._group_by()))
diff --git a/hr_payslip_monthly_report/report/hr_payslip_report_views.xml b/hr_payslip_monthly_report/report/hr_payslip_report_views.xml
new file mode 100644
index 000000000..00971e8bb
--- /dev/null
+++ b/hr_payslip_monthly_report/report/hr_payslip_report_views.xml
@@ -0,0 +1,88 @@
+
+
+
+
+ hr.payroll.view.pivot
+ hr.payroll.report
+
+
+
+
+
+
+
+
+
+
+ hr.payroll.view.graph
+ hr.payroll.report
+
+
+
+
+
+
+
+
+
+ hr.payroll.select
+ hr.payroll.report
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hr.payroll.report
+ Payslips
+ pivot,graph
+ {'search_default_year':1}
+ This report helps in payroll analysis. This helps you
+ to check your payslips and sorting it out from different group
+ criteria (Employee, Job title, Department, Company, Pay slip etc.).
+
+
+
+
+
+
\ No newline at end of file
diff --git a/hr_payslip_monthly_report/security/ir.model.access.csv b/hr_payslip_monthly_report/security/ir.model.access.csv
new file mode 100644
index 000000000..0956fda07
--- /dev/null
+++ b/hr_payslip_monthly_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_hr_payslip_monthly_report_manager,hr.payroll.report,model_hr_payroll_report,hr_payroll_community.group_hr_payroll_community_user,1,1,1,1
+access_group_user,Access User,model_payslip_confirm,hr_payroll_community.group_hr_payroll_community_user,1,1,1,1
\ No newline at end of file
diff --git a/hr_payslip_monthly_report/static/description/assets/icons/capture (1).png b/hr_payslip_monthly_report/static/description/assets/icons/capture (1).png
new file mode 100644
index 0000000000000000000000000000000000000000..8824deafca0ae1d56fce83c80cc8ae543855dc68
GIT binary patch
literal 36623
zcmdSBg;$i_7dAYI0wOh{AWAt%C?z1B!T?HlhcuGX9g4uv-K7IaN-7;nhkytJ(p^J$
z!+YQG_Cy9^y5ElZ0;J(Vh_HZ{
ztYw^P;Dy@gm69w3;!X#F_yPJlo8E<+$r&mj=>8wi9i5dtB7ms+DJ0DORDC@l#G
zUV-OWtkws3x&7{yrUUT$=IY;;rDz}U2HWwqtT^@(_8rXI*qbU+Jiv&M*YKAruA^%c
zE-ET!vu)c;^)GH2H9z!VWpmCnWDQbULq3hyfJm!|7zIgu=>LmR`zAz?&-v*?>B7Gy
zmdMh>V2W7w!}Igc#y+(v#wg#-@uVe(-gLpcbKVB1q|T-u*yXJFL+oT;|v+}gc67hMGk3_Y6+9-)_1u
zY$#@5_UnDrT_u>XM37hnWza2zxNW(n0BO&*xM!UX%T&Ux*|~)`Oc)ze!|~|N5$lME
z1R4taAgYb2KCRR3hMSwK!+x!Dr3!VfpHBv8ke6*3zRMIxb0Xfq%QuOaytm%}DxQFD
zsuvU4i)-;>klf>&eh-cJ~(suNulGfp(Vapbp3pSmZ~4cgv4$w53k
zpG>7oWL^E
z@Br4c)Mv>$Z&M4UmorY$a&%A>uwmpiH*Z&yO&kH)c6CDGa(+a68`RuKOcOHh#@5K_hhZ
zsdCTQZ7HXIK(jNxVQA7lNq>d6I-*=P4b8`Yc#}AP&TytF{}l1ZpS$SOmyyu$BYf80
zwB}c5p$+tM2w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