Browse Source

Aug 12: [FIX] Bug Fixed 'employee_late_check_in'

pull/332/merge
Cybrosys Technologies 9 months ago
parent
commit
62e0d50b03
  1. 10
      employee_late_check_in/README.rst
  2. 29
      employee_late_check_in/__init__.py
  3. 81
      employee_late_check_in/__manifest__.py
  4. 26
      employee_late_check_in/data/ir_cron_data.xml
  5. 5
      employee_late_check_in/data/salary_rule.xml
  6. 7
      employee_late_check_in/doc/RELEASE_NOTES.md
  7. 16
      employee_late_check_in/models/__init__.py
  8. 136
      employee_late_check_in/models/hr_attendance.py
  9. 51
      employee_late_check_in/models/hr_employee.py
  10. 50
      employee_late_check_in/models/hr_employees_public.py
  11. 55
      employee_late_check_in/models/hr_payslip.py
  12. 86
      employee_late_check_in/models/late_check_in.py
  13. 47
      employee_late_check_in/models/res_company.py
  14. 55
      employee_late_check_in/models/res_config_settings.py
  15. 0
      employee_late_check_in/security/ir.model.access.csv
  16. 0
      employee_late_check_in/static/description/assets/icons/check.png
  17. 0
      employee_late_check_in/static/description/assets/icons/chevron.png
  18. 0
      employee_late_check_in/static/description/assets/icons/cogs.png
  19. 0
      employee_late_check_in/static/description/assets/icons/consultation.png
  20. 0
      employee_late_check_in/static/description/assets/icons/ecom-black.png
  21. 0
      employee_late_check_in/static/description/assets/icons/education-black.png
  22. 0
      employee_late_check_in/static/description/assets/icons/hotel-black.png
  23. 0
      employee_late_check_in/static/description/assets/icons/license.png
  24. 0
      employee_late_check_in/static/description/assets/icons/lifebuoy.png
  25. 0
      employee_late_check_in/static/description/assets/icons/manufacturing-black.png
  26. 0
      employee_late_check_in/static/description/assets/icons/pos-black.png
  27. 0
      employee_late_check_in/static/description/assets/icons/puzzle.png
  28. 0
      employee_late_check_in/static/description/assets/icons/restaurant-black.png
  29. 0
      employee_late_check_in/static/description/assets/icons/service-black.png
  30. 0
      employee_late_check_in/static/description/assets/icons/trading-black.png
  31. 0
      employee_late_check_in/static/description/assets/icons/training.png
  32. 0
      employee_late_check_in/static/description/assets/icons/update.png
  33. 0
      employee_late_check_in/static/description/assets/icons/user.png
  34. 0
      employee_late_check_in/static/description/assets/icons/wrench.png
  35. 0
      employee_late_check_in/static/description/assets/misc/Cybrosys R.png
  36. 0
      employee_late_check_in/static/description/assets/misc/categories.png
  37. 0
      employee_late_check_in/static/description/assets/misc/check-box.png
  38. 0
      employee_late_check_in/static/description/assets/misc/compass.png
  39. 0
      employee_late_check_in/static/description/assets/misc/corporate.png
  40. 0
      employee_late_check_in/static/description/assets/misc/customer-support.png
  41. 0
      employee_late_check_in/static/description/assets/misc/cybrosys-logo.png
  42. 0
      employee_late_check_in/static/description/assets/misc/features.png
  43. 0
      employee_late_check_in/static/description/assets/misc/logo.png
  44. 0
      employee_late_check_in/static/description/assets/misc/pictures.png
  45. 0
      employee_late_check_in/static/description/assets/misc/pie-chart.png
  46. 0
      employee_late_check_in/static/description/assets/misc/right-arrow.png
  47. 0
      employee_late_check_in/static/description/assets/misc/star.png
  48. 0
      employee_late_check_in/static/description/assets/misc/support.png
  49. 0
      employee_late_check_in/static/description/assets/misc/whatsapp.png
  50. 0
      employee_late_check_in/static/description/assets/modules/1.png
  51. 0
      employee_late_check_in/static/description/assets/modules/2.png
  52. 0
      employee_late_check_in/static/description/assets/modules/3.png
  53. 0
      employee_late_check_in/static/description/assets/modules/4.png
  54. 0
      employee_late_check_in/static/description/assets/modules/5.png
  55. 0
      employee_late_check_in/static/description/assets/modules/6.png
  56. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_1.png
  57. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_10.png
  58. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_2.png
  59. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_3.png
  60. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_4.png
  61. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_5.png
  62. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_6.png
  63. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_7.png
  64. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_8.png
  65. 0
      employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_9.png
  66. 0
      employee_late_check_in/static/description/assets/screenshots/hero.gif
  67. 0
      employee_late_check_in/static/description/banner.png
  68. 0
      employee_late_check_in/static/description/icon.png
  69. 0
      employee_late_check_in/static/description/index.html
  70. 0
      employee_late_check_in/views/hr_attendance_views.xml
  71. 0
      employee_late_check_in/views/hr_employee_views.xml
  72. 0
      employee_late_check_in/views/hr_payslip_views.xml
  73. 1
      employee_late_check_in/views/late_check_in_views.xml
  74. 45
      employee_late_check_in/views/res_config_settings_views.xml

10
employee_late_check_in/README.rst

@ -1,6 +1,6 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
Employee Late Check-in
======================
@ -16,8 +16,8 @@ Company
License
-------
Affero General Public License, Version 3 (AGPL v3).
(https://www.gnu.org/licenses/agpl-3.0-standalone.html)
* Lesser General Public License, Version 3 (LGPL v3).
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html)
Credits
-------

29
employee_late_check_in/__init__.py

@ -1,35 +1,22 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
############################################################################.
from . import models
from odoo import SUPERUSER_ID
from odoo.api import Environment
def post_init_hook(cr, registry):
env = Environment(cr, SUPERUSER_ID, {})
cron = env.ref('employee_late_check_in.ir_cron_late_check_in',
raise_if_not_found=False)
if cron:
model = env[cron.model_id.model]
method = getattr(model, 'late_check_in_records', None)
if method:
method()

81
employee_late_check_in/__manifest__.py

@ -1,57 +1,56 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
############################################################################.
{
"name": "Employee Late Check-in",
"version": "16.0.1.0.1",
"category": "Human Resources",
"summary": "Employee Late Check-in module for tracking and managing late "
"check-ins of employees and may deduct salary from payslip",
"description": "The module is designed for meticulous tracking and "
"management of employee punctuality. It enables "
"organizations to monitor late check-ins efficiently, "
"offering insights into tardiness patterns. With a "
"user-friendly interface, it provides a comprehensive "
"overview of individual employee records, facilitating "
"timely interventions. This module contributes to fostering"
" a punctual and efficient work environment.",
"author": "Cybrosys Techno Solutions",
"company": "Cybrosys Techno Solutions",
"maintainer": "Cybrosys Techno Solutions",
"website": "https://www.cybrosys.com",
"depends": ["hr_attendance", "hr_payroll_community"],
"data": [
"security/ir.model.access.csv",
"data/ir_cron_data.xml",
"data/salary_rule.xml",
"views/res_config_settings_views.xml",
"views/hr_attendance_views.xml",
"views/late_check_in_views.xml",
"views/hr_employee_views.xml",
"views/hr_payslip_views.xml",
'name': 'Employee Late Check-in',
'version': '16.0.1.0.0',
'category': 'Human Resources',
'summary': 'Employee Late Check-in module for tracking and managing late '
'check-ins of employees and may deduct salary from payslip',
'description': 'The module is designed for meticulous tracking and '
'management of employee punctuality. It enables '
'organizations to monitor late check-ins efficiently, '
'offering insights into tardiness patterns. With a '
'user-friendly interface, it provides a comprehensive '
'overview of individual employee records, facilitating '
'timely interventions. This module contributes to fostering'
' a punctual and efficient work environment.',
'author': "Cybrosys Techno Solutions",
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ['hr_attendance', 'hr_payroll_community', 'hr_contract_types'],
'data': [
'security/ir.model.access.csv',
'data/ir_cron_data.xml',
'data/salary_rule.xml',
'views/res_config_settings_views.xml',
'views/hr_attendance_views.xml',
'views/late_check_in_views.xml',
'views/hr_employee_views.xml',
'views/hr_payslip_views.xml',
],
"images": ["static/description/banner.png"],
"license": "AGPL-3",
"installable": True,
"auto_install": False,
"application": False,
"post_init_hook": "post_init_hook"
'images': ['static/description/banner.png'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

26
employee_late_check_in/data/ir_cron_data.xml

@ -1,17 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--The daily function late_check_in_records verifies whether employees are tardy.-->
<record forcecreate="True" id="ir_cron_late_check_in" model="ir.cron">
<field name="name">Attendance: Late Check-in</field>
<field name="model_id" ref="model_hr_attendance"/>
<field name="state">code</field>
<field name="code">model.late_check_in_records()</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
</record>
<!--The daily function late_check_in_records verifies whether employees are tardy.-->
<record forcecreate="True" id="ir_cron_late_check_in" model="ir.cron">
<field name="name">Attendance: Late Check-in</field>
<field name="model_id" ref="model_hr_attendance"/>
<field name="state">code</field>
<field name="code">model.late_check_in_records()</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
</record>
</odoo>

5
employee_late_check_in/data/salary_rule.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--Calculate the amount for the 'Late Check-in' rule.-->
<!--Calculate the amount for the 'Late Check-in' rule.-->
<record id="late_check_in" model="hr.salary.rule">
<field name="name">Late Check-in</field>
<field name="sequence" eval="6"/>
@ -14,7 +14,8 @@ try:
amount = inputs.LC.amount
except:
amount = 0
result = -amount</field>
result = -amount
</field>
</record>
<!--Salary structure for late check-in-->
<record id="late_check_in_salary_structure" model="hr.payroll.structure">

7
employee_late_check_in/doc/RELEASE_NOTES.md

@ -10,3 +10,10 @@
#### Version 16.0.1.0.1
#### UPDATE
- Updated scheduled action and ensured amount updates in the late-check-in. Displayed time-off when generating payslip and deducted late check in amount from it.
#### 12.08.2024
#### Version 16.0.1.0.2
#### UPDATE
- Bug Fix in Employee Late Check-in

16
employee_late_check_in/models/__init__.py

@ -1,24 +1,24 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
############################################################################.
from . import hr_attendance
from . import hr_employee
from . import hr_employees_public

136
employee_late_check_in/models/hr_attendance.py

@ -1,40 +1,39 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
############################################################################.
import pytz
from datetime import datetime, timedelta
from odoo import fields, models
from odoo import api,fields, models
class HrAttendance(models.Model):
"""Inherit the module to add fields and methods"""
_inherit = "hr.attendance"
_inherit = 'hr.attendance'
late_check_in = fields.Integer(
string="Late Check-in(Minutes)",
compute="_compute_late_check_in",
string="Late Check-in(Minutes)", compute="_compute_late_check_in",
help="This indicates the duration of the employee's tardiness.",
)
store=True)
@api.depends('check_in')
def _compute_late_check_in(self):
"""Calculate late check-in minutes for each record in the current Odoo
model.This method iterates through the records and calculates late
@ -44,77 +43,62 @@ class HrAttendance(models.Model):
for rec in self:
rec.late_check_in = 0.0
if rec.employee_id.contract_id:
for schedule in (
rec.sudo()
.employee_id.contract_id.resource_calendar_id.sudo()
.attendance_ids
):
if (
schedule.dayofweek == str(rec.sudo().check_in.weekday())
and schedule.day_period == "morning"
):
for schedule in rec.sudo().employee_id.contract_id.resource_calendar_id.sudo().attendance_ids:
if (schedule.dayofweek == str(
rec.sudo().check_in.weekday()) and
schedule.day_period == 'morning'):
dt = rec.check_in
if self.env.user.tz in pytz.all_timezones:
old_tz = pytz.timezone("UTC")
old_tz = pytz.timezone('UTC')
new_tz = pytz.timezone(self.env.user.tz)
dt = old_tz.localize(dt).astimezone(new_tz)
str_time = dt.strftime("%H:%M")
check_in_date = datetime.strptime(str_time, "%H:%M").time()
check_in_date = datetime.strptime(
str_time, "%H:%M").time()
start_date = datetime.strptime(
"{0:02.0f}:{1:02.0f}".format(
*divmod(schedule.hour_from * 60, 60)
),
"%H:%M",
).time()
check_in = timedelta(
hours=check_in_date.hour, minutes=check_in_date.minute
)
start_date = timedelta(
hours=start_date.hour, minutes=start_date.minute
)
'{0:02.0f}:{1:02.0f}'.format(*divmod(
schedule.hour_from * 60, 60)),
"%H:%M").time()
check_in = timedelta(hours=check_in_date.hour,
minutes=check_in_date.minute)
start_date = timedelta(hours=start_date.hour,
minutes=start_date.minute)
if check_in > start_date:
final = check_in - start_date
rec.sudo().late_check_in = final.total_seconds() / 60
def late_check_in_records(self):
"""Function creates records in late.check.in model for the employees
who were late as a scheduled action"""
minutes_after = (
int(
self.env["ir.config_parameter"]
.sudo()
.get_param("employee_late_check_in.late_check_in_after")
)
or 0
)
max_limit = (
int(
self.env["ir.config_parameter"]
.sudo()
.get_param("employee_late_check_in.maximum_minutes")
)
or 0
)
for rec in self.sudo().search(
[
(
"id",
"not in",
self.env["late.check.in"].sudo().search([]).attendance_id.ids,
)
]
):
late_check_in = rec.sudo().late_check_in + 210
if (
rec.late_check_in > minutes_after
and late_check_in > minutes_after
and late_check_in < max_limit
):
self.env["late.check.in"].sudo().create(
{
"employee_id": rec.employee_id.id,
"late_minutes": late_check_in,
"date": rec.check_in.date(),
"attendance_id": rec.id,
}
)
who were late"""
minutes_after = int(
self.env['ir.config_parameter'].sudo().get_param(
'employee_late_check_in.late_check_in_after')) or 0
max_limit = int(self.env['ir.config_parameter'].sudo().get_param(
'employee_late_check_in.maximum_minutes')) or 0
for rec in self.sudo().search([]):
print(rec,minutes_after)
if rec.id not in self.env['late.check.in'].sudo().search(
[]).attendance_id.ids:
if minutes_after < rec.late_check_in < max_limit:
print(rec,'rec')
self.env['late.check.in'].sudo().create({
'employee_id': rec.employee_id.id,
'late_minutes': rec.late_check_in,
'date': rec.check_in.date(),
'attendance_id': rec.id,
})
else:
self.env['late.check.in'].sudo().search(
[('attendance_id', '=', rec.id)]).update({
'late_minutes': rec.late_check_in,
'date': rec.check_in.date(),
'attendance_id': rec.id,
})
def unlink(self):
"""Override the unlink method to delete the corresponding records in
late.check.in model"""
for record in self:
self.env['late.check.in'].sudo().search(
[('attendance_id', '=', record.id)]).unlink()
return super(HrAttendance, self).unlink()

51
employee_late_check_in/models/hr_employee.py

@ -1,56 +1,51 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
from odoo import fields, models, _
############################################################################.
from odoo import _, fields, models
class HrEmployee(models.Model):
"""Inherit the model to add fields and methods"""
_inherit = "hr.employee"
_inherit = 'hr.employee'
late_check_in_count = fields.Integer(
string="Late Check-In",
compute="_compute_late_check_in_count",
help="Count of employee's late checkin",
)
string="Late Check-In", compute="_compute_late_check_in_count",
help="Count of employee's late checkin")
def action_to_open_late_check_in_records(self):
"""
:return: dictionary defining the action to open the late check-in
records window.
:rtype: dict
:return: dictionary defining the action to open the late check-in
records window.
:rtype: dict
"""
return {
"name": _("Employee Late Check-in"),
"domain": [("employee_id", "=", self.id)],
"res_model": "late.check.in",
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"limit": 80,
}
'name': _('Employee Late Check-in'),
'domain': [('employee_id', '=', self.id)],
'res_model': 'late.check.in',
'type': 'ir.actions.act_window',
'view_mode': 'tree,form',
'limit': 80}
def _compute_late_check_in_count(self):
"""Compute the late check-in count"""
for rec in self:
rec.late_check_in_count = self.env["late.check.in"].search_count(
[("employee_id", "=", rec.id)]
)
rec.late_check_in_count = self.env['late.check.in'].search_count(
[('employee_id', '=', rec.id)])

50
employee_late_check_in/models/hr_employees_public.py

@ -1,56 +1,52 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
from odoo import fields, models, _
############################################################################.
from odoo import _, fields, models
class HrEmployees(models.Model):
"""Inherit the model to add fields and functions"""
_inherit = "hr.employee.public"
_inherit = 'hr.employee.public'
late_check_in_count = fields.Integer(
string="Late Check-In",
compute="_compute_late_check_in_count",
help="Count of employee's late checkin",
)
string="Late Check-In", compute="_compute_late_check_in_count",
help="Count of employee's late checkin")
def action_to_open_late_check_in_records(self):
"""
:return: dictionary defining the action to open the late check-in
records window.
:rtype: dict
:return: dictionary defining the action to open the late check-in
records window.
:rtype: dict
"""
return {
"name": _("Employee Late Check-in"),
"domain": [("employee_id", "=", self.id)],
"res_model": "late.check.in",
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"limit": 80,
'name': _('Employee Late Check-in'),
'domain': [('employee_id', '=', self.id)],
'res_model': 'late.check.in',
'type': 'ir.actions.act_window',
'view_mode': 'tree,form',
'limit': 80,
}
def _compute_late_check_in_count(self):
"""Compute the late check-in count"""
for rec in self:
rec.late_check_in_count = self.env["late.check.in"].search_count(
[("employee_id", "=", rec.id)]
)
rec.late_check_in_count = self.env['late.check.in'].search_count(
[('employee_id', '=', rec.id)])

55
employee_late_check_in/models/hr_payslip.py

@ -1,59 +1,54 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
############################################################################.
from odoo import api, fields, models
class PayslipLateCheckIn(models.Model):
"""Inherit the model to add fields and functions"""
_inherit = "hr.payslip"
_inherit = 'hr.payslip'
late_check_in_ids = fields.Many2many(
"late.check.in",
string="Late Check-in",
help="Late check-in records of the employee",
)
'late.check.in', string='Late Check-in',
help='Late check-in records of the employee')
@api.model
def get_inputs(self, contracts, date_from, date_to):
"""Function used for writing late check-in record in the payslip input
tree."""
res = super(PayslipLateCheckIn, self).get_inputs(contracts, date_to, date_from)
late_check_in_type = self.env.ref("employee_late_check_in.late_check_in")
late_check_in_id = self.env["late.check.in"].search(
[
("employee_id", "=", self.employee_id.id),
("date", "<=", self.date_to),
("date", ">=", self.date_from),
("state", "=", "approved"),
]
)
tree."""
res = super(PayslipLateCheckIn, self).get_inputs(contracts, date_to,
date_from)
late_check_in_type = self.env.ref(
'employee_late_check_in.late_check_in')
late_check_in_id = self.env['late.check.in'].search(
[('employee_id', '=', self.employee_id.id),
('date', '<=', self.date_to), ('date', '>=', self.date_from),
('state', '=', 'approved')])
if late_check_in_id:
self.late_check_in_ids = late_check_in_id
input_data = {
"name": late_check_in_type.name,
"code": late_check_in_type.code,
"amount": sum(late_check_in_id.mapped("penalty_amount")),
"contract_id": self.contract_id.id,
'name': late_check_in_type.name,
'code': late_check_in_type.code,
'amount': sum(late_check_in_id.mapped('penalty_amount')),
'contract_id': self.contract_id.id,
}
res.append(input_data)
return res
@ -61,5 +56,5 @@ class PayslipLateCheckIn(models.Model):
def action_payslip_done(self):
"""Function used for marking deducted Late check-in request."""
for rec in self.late_check_in_ids:
rec.state = "deducted"
rec.state = 'deducted'
return super(PayslipLateCheckIn, self).action_payslip_done()

86
employee_late_check_in/models/late_check_in.py

@ -1,87 +1,73 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
############################################################################.
from odoo import api, fields, models
class LateCheckIn(models.Model):
"""Model to store late check-in records"""
_name = "late.check.in"
_description = "Late Check In"
_name = 'late.check.in'
_description = 'Late Check In'
name = fields.Char(
readonly=True, string="Name", help="Reference number of the record"
)
employee_id = fields.Many2one(
"hr.employee", string="Employee", help="Late employee"
)
late_minutes = fields.Integer(
string="Late Minutes",
help="The field indicates the number of minutes the worker is late.",
)
date = fields.Date(string="Date", help="Current date")
penalty_amount = fields.Float(
compute="_compute_penalty_amount",
help="Amount needs to be deducted",
string="Amount",
)
state = fields.Selection(
selection=[
("draft", "Draft"),
("approved", "Approved"),
("refused", "Refused"),
("deducted", "Deducted"),
],
string="State",
default="draft",
help="State of the record",
)
attendance_id = fields.Many2one(
"hr.attendance", string="Attendance", help="Attendance of the employee"
)
readonly=True, string='Name', help="Reference number of the record")
employee_id = fields.Many2one('hr.employee', string="Employee",
help='Late employee')
late_minutes = fields.Integer(string="Late Minutes",
help='The field indicates the number of '
'minutes the worker is late.')
date = fields.Date(string="Date", help='Current date')
penalty_amount = fields.Float(compute="_compute_penalty_amount",
help='Amount needs to be deducted',
string="Amount",)
state = fields.Selection(selection=[('draft', 'Draft'),
('approved', 'Approved'),
('refused', 'Refused'),
('deducted', 'Deducted')],
string="State", default="draft",
help='State of the record')
attendance_id = fields.Many2one('hr.attendance', string='Attendance',
help='Attendance of the employee')
@api.model
def create(self, vals_list):
"""Create a sequence for the model"""
vals_list["name"] = self.env["ir.sequence"].next_by_code("late.check.in") or "/"
vals_list['name'] = self.env['ir.sequence'].next_by_code(
'late.check.in') or '/'
return super(LateCheckIn, self.sudo()).create(vals_list)
def _compute_penalty_amount(self):
"""Compute the penalty amount if the employee was late"""
for rec in self:
amount = float(
self.env["ir.config_parameter"].sudo().get_param("employee_late_check_in.deduction_amount")
)
amount = float(self.env['ir.config_parameter'].sudo().get_param(
'employee_late_check_in.deduction_amount'))
rec.penalty_amount = amount
if (
self.env["ir.config_parameter"].sudo().get_param("employee_late_check_in.deduction_type")
== "minutes"
):
if self.env['ir.config_parameter'].sudo().get_param(
'employee_late_check_in.deduction_type') == 'minutes':
rec.penalty_amount = amount * rec.late_minutes
def approve(self):
"""Change state to approved when approve button clicks"""
self.state = "approved"
self.state = 'approved'
def reject(self):
"""Change state refused when refuse button clicks"""
self.state = "refused"
self.state = 'refused'

47
employee_late_check_in/models/res_company.py

@ -1,52 +1,45 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
############################################################################.
from odoo import fields, models
class ResCompany(models.Model):
"""Inherit the model to add fields"""
_inherit = "res.company"
_inherit = 'res.company'
deduction_amount = fields.Float(
help="How much amount need to be deducted if a employee was late",
string="Deduction Amount",
)
help='How much amount need to be deducted if a employee was late',
string="Deduction Amount",)
currency_id = fields.Many2one(
"res.currency", default=lambda self: self.env.company.currency_id.id
)
'res.currency', default=lambda self: self.env.company.currency_id.id)
maximum_minutes = fields.Char(
help="Maximum time limit a employee was considered as late",
string="Maximum Late Minute",
)
string="Maximum Late Minute")
late_check_in_after = fields.Char(
help="When should the late check-in count down starts.",
string="Late Check-in Starts After",
)
help='When should the late check-in count down starts.',
string="Late Check-in Starts After",)
deduction_type = fields.Selection(
selection=[("minutes", "Per Minutes"), ("total", "Per Total")],
default="minutes",
string="Deduction Type",
help="Type of deduction, (If Per Minutes is chosen then for each "
"minutes given amount is deducted, if Per Total is chosen then "
"given amount is deducted from the total salary)",
)
selection=[('minutes', 'Per Minutes'), ('total', 'Per Total')],
default="minutes", string='Deduction Type',
help='Type of deduction, (If Per Minutes is chosen then for each '
'minutes given amount is deducted, if Per Total is chosen then '
'given amount is deducted from the total salary)')

55
employee_late_check_in/models/res_config_settings.py

@ -1,56 +1,49 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
############################################################################.
from odoo import fields, models
class LateCheckinSettings(models.TransientModel):
"""Inherit the model to add fields"""
_inherit = "res.config.settings"
_inherit = 'res.config.settings'
deduction_amount = fields.Float(
config_parameter="employee_late_check_in.deduction_amount",
help="How much amount need to be deducted if a employee was late",
string="Deduction Amount",
)
config_parameter='employee_late_check_in.deduction_amount',
help='How much amount need to be deducted if a employee was late',
string="Deduction Amount",)
maximum_minutes = fields.Char(
config_parameter="employee_late_check_in.maximum_minutes",
config_parameter='employee_late_check_in.maximum_minutes',
help="Maximum time limit a employee was considered as late",
string="Maximum Late Minute",
)
string="Maximum Late Minute")
late_check_in_after = fields.Char(
config_parameter="employee_late_check_in.late_check_in_after",
help="When should the late check-in count down starts.",
string="Late Check-in Starts After",
)
config_parameter='employee_late_check_in.late_check_in_after',
help='When should the late check-in count down starts.',
string="Late Check-in Starts After",)
deduction_type = fields.Selection(
selection=[("minutes", "Per Minutes"), ("total", "Per Total")],
config_parameter="employee_late_check_in.deduction_type",
default="minutes",
string="Deduction Type",
help="Type of deduction, (If Per Minutes is chosen then for each "
"minutes given amount is deducted, if Per Total is chosen then "
"given amount is deducted from the total salary)",
)
selection=[('minutes', 'Per Minutes'), ('total', 'Per Total')],
config_parameter='employee_late_check_in.deduction_type',
default="minutes", string='Deduction Type',
help='Type of deduction, (If Per Minutes is chosen then for each '
'minutes given amount is deducted, if Per Total is chosen then '
'given amount is deducted from the total salary)')
currency_id = fields.Many2one(
"res.currency", default=lambda self: self.env.company.currency_id.id
)
'res.currency', default=lambda self: self.env.company.currency_id.id)

0
employee_late_check_in/security/ir.model.access.csv

0
employee_late_check_in/static/description/assets/icons/check.png

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

0
employee_late_check_in/static/description/assets/icons/chevron.png

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 310 B

0
employee_late_check_in/static/description/assets/icons/cogs.png

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

0
employee_late_check_in/static/description/assets/icons/consultation.png

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
employee_late_check_in/static/description/assets/icons/ecom-black.png

Before

Width:  |  Height:  |  Size: 576 B

After

Width:  |  Height:  |  Size: 576 B

0
employee_late_check_in/static/description/assets/icons/education-black.png

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

0
employee_late_check_in/static/description/assets/icons/hotel-black.png

Before

Width:  |  Height:  |  Size: 911 B

After

Width:  |  Height:  |  Size: 911 B

0
employee_late_check_in/static/description/assets/icons/license.png

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
employee_late_check_in/static/description/assets/icons/lifebuoy.png

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
employee_late_check_in/static/description/assets/icons/manufacturing-black.png

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 673 B

0
employee_late_check_in/static/description/assets/icons/pos-black.png

Before

Width:  |  Height:  |  Size: 878 B

After

Width:  |  Height:  |  Size: 878 B

0
employee_late_check_in/static/description/assets/icons/puzzle.png

Before

Width:  |  Height:  |  Size: 653 B

After

Width:  |  Height:  |  Size: 653 B

0
employee_late_check_in/static/description/assets/icons/restaurant-black.png

Before

Width:  |  Height:  |  Size: 905 B

After

Width:  |  Height:  |  Size: 905 B

0
employee_late_check_in/static/description/assets/icons/service-black.png

Before

Width:  |  Height:  |  Size: 839 B

After

Width:  |  Height:  |  Size: 839 B

0
employee_late_check_in/static/description/assets/icons/trading-black.png

Before

Width:  |  Height:  |  Size: 427 B

After

Width:  |  Height:  |  Size: 427 B

0
employee_late_check_in/static/description/assets/icons/training.png

Before

Width:  |  Height:  |  Size: 627 B

After

Width:  |  Height:  |  Size: 627 B

0
employee_late_check_in/static/description/assets/icons/update.png

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
employee_late_check_in/static/description/assets/icons/user.png

Before

Width:  |  Height:  |  Size: 988 B

After

Width:  |  Height:  |  Size: 988 B

0
employee_late_check_in/static/description/assets/icons/wrench.png

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
employee_late_check_in/static/description/assets/misc/Cybrosys R.png

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

0
employee_late_check_in/static/description/assets/misc/categories.png

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

0
employee_late_check_in/static/description/assets/misc/check-box.png

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
employee_late_check_in/static/description/assets/misc/compass.png

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
employee_late_check_in/static/description/assets/misc/corporate.png

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
employee_late_check_in/static/description/assets/misc/customer-support.png

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

0
employee_late_check_in/static/description/assets/misc/cybrosys-logo.png

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

0
employee_late_check_in/static/description/assets/misc/features.png

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 589 B

0
employee_late_check_in/static/description/assets/misc/logo.png

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

0
employee_late_check_in/static/description/assets/misc/pictures.png

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
employee_late_check_in/static/description/assets/misc/pie-chart.png

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

0
employee_late_check_in/static/description/assets/misc/right-arrow.png

Before

Width:  |  Height:  |  Size: 967 B

After

Width:  |  Height:  |  Size: 967 B

0
employee_late_check_in/static/description/assets/misc/star.png

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

0
employee_late_check_in/static/description/assets/misc/support.png

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

0
employee_late_check_in/static/description/assets/misc/whatsapp.png

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

0
employee_late_check_in/static/description/assets/modules/1.png

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

0
employee_late_check_in/static/description/assets/modules/2.png

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

0
employee_late_check_in/static/description/assets/modules/3.png

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

0
employee_late_check_in/static/description/assets/modules/4.png

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

0
employee_late_check_in/static/description/assets/modules/5.png

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

0
employee_late_check_in/static/description/assets/modules/6.png

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_1.png

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_10.png

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 127 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_2.png

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_3.png

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_4.png

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_5.png

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_6.png

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_7.png

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 215 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_8.png

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

0
employee_late_check_in/static/description/assets/screenshots/employee_late_check_in_9.png

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

0
employee_late_check_in/static/description/assets/screenshots/hero.gif

Before

Width:  |  Height:  |  Size: 273 KiB

After

Width:  |  Height:  |  Size: 273 KiB

0
employee_late_check_in/static/description/banner.png

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

0
employee_late_check_in/static/description/icon.png

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

0
employee_late_check_in/static/description/index.html

0
employee_late_check_in/views/hr_attendance_views.xml

0
employee_late_check_in/views/hr_employee_views.xml

0
employee_late_check_in/views/hr_payslip_views.xml

1
employee_late_check_in/views/late_check_in_views.xml

@ -74,7 +74,6 @@
<field name="late_minutes"/>
<field name="date"/>
<field name="penalty_amount"/>
<field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'approved'"/>
</tree>
</field>
</record>

45
employee_late_check_in/views/res_config_settings_views.xml

@ -1,20 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Adding fields in res.config.settings-->
Adding fields in res.config.settings
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.employee.late.check.in</field>
<field name="name">
res.config.settings.view.form.inherit.employee.late.check.in
</field>
<field name="model">res.config.settings</field>
<field name="inherit_id"
ref="hr_attendance.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('app_settings_block')][@data-key='hr_attendance']" position="inside">
<xpath expr="//div[hasclass('app_settings_block')][@data-key='hr_attendance']"
position="inside">
<h2>Late Check-in</h2>
<div class="row mt16 o_settings_container" name="late_check_in">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="deduction_amount" class="o_form_label">Deduction Amount</label>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific."
role="img" aria-label="Values set here are company-specific."
<label for="deduction_amount" class="o_form_label">
Deduction Amount
</label>
<span class="fa fa-lg fa-building-o"
title="Values set here are company-specific."
role="img"
aria-label="Values set here are company-specific."
groups="base.group_multi_company"/>
<div class="text-muted">
Amount to be deducted from payslip.
@ -25,27 +32,41 @@
</div>
<div class="mt16">
<div class="mt16 row">
<field name="deduction_amount" widget="monetary"/>
<field name="deduction_amount"
widget="monetary"/>
<field name="deduction_type"/>
</div>
<br/>
<label for="late_check_in_after" class="o_form_label">
<label for="late_check_in_after"
class="o_form_label">
Late Check In Starts After
</label>
<div class="text-muted">
When should the late check-in count down starts.
When should the late check-in count down
starts.
</div>
<field name="late_check_in_after"/>
<span>Minutes</span>
<br/>
<br/>
<label for="maximum_minutes" class="o_form_label">
<label for="maximum_minutes"
class="o_form_label">
Maximum Late Minutes
</label>
<div class="text-muted">
Maximum time limit a employee was considered as late.
Specifies the maximum threshold for
recording late check-ins.
(Enter the number of minutes after which a
check-in is treated as an absence or another
type of leave,etc.
For example, if set to 100, a check-in that
is 99 minutes late will be recorded as a
late check-in, but a check-in that is 101
minutes late will not be recorded as a late
check-in.)
</div>
<field name="maximum_minutes"/><span>Minutes</span>
<field name="maximum_minutes"/>
<span>Minutes</span>
</div>
</div>
</div>

Loading…
Cancel
Save