Browse Source

Apr 17 [UPDT] : Bug Fixed 'employee_late_check_in'

pull/278/merge
AjmalCybro 1 year ago
parent
commit
ec18bfccfd
  1. 13
      employee_late_check_in/__init__.py
  2. 3
      employee_late_check_in/__manifest__.py
  3. 2
      employee_late_check_in/data/ir_cron_data.xml
  4. 5
      employee_late_check_in/doc/RELEASE_NOTES.md
  5. 6
      employee_late_check_in/models/late_check_in.py
  6. 1
      employee_late_check_in/views/late_check_in_views.xml

13
employee_late_check_in/__init__.py

@ -20,3 +20,16 @@
#
###############################################################################
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()

3
employee_late_check_in/__manifest__.py

@ -21,7 +21,7 @@
###############################################################################
{
"name": "Employee Late Check-in",
"version": "16.0.1.0.0",
"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",
@ -53,4 +53,5 @@
"installable": True,
"auto_install": False,
"application": False,
"post_init_hook": "post_init_hook"
}

2
employee_late_check_in/data/ir_cron_data.xml

@ -13,3 +13,5 @@
<field name="doall" eval="False"/>
</record>
</odoo>

5
employee_late_check_in/doc/RELEASE_NOTES.md

@ -5,3 +5,8 @@
#### ADD
- Initial Commit for Employee Late Check-in
#### 17.04.2024
#### 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.

6
employee_late_check_in/models/late_check_in.py

@ -36,7 +36,7 @@ class LateCheckIn(models.Model):
)
late_minutes = fields.Integer(
string="Late Minutes",
help="The field indicates the number of " "minutes the worker is late.",
help="The field indicates the number of minutes the worker is late.",
)
date = fields.Date(string="Date", help="Current date")
penalty_amount = fields.Float(
@ -69,11 +69,11 @@ class LateCheckIn(models.Model):
"""Compute the penalty amount if the employee was late"""
for rec in self:
amount = float(
self.env["ir.config_parameter"].sudo().get_param("deduction_amount")
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("deduction_type")
self.env["ir.config_parameter"].sudo().get_param("employee_late_check_in.deduction_type")
== "minutes"
):
rec.penalty_amount = amount * rec.late_minutes

1
employee_late_check_in/views/late_check_in_views.xml

@ -74,6 +74,7 @@
<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>

Loading…
Cancel
Save