@ -1,57 +1,56 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################### |
############################################################################# |
||||
# |
# |
||||
# Cybrosys Technologies Pvt. Ltd. |
# Cybrosys Technologies Pvt. Ltd. |
||||
# |
# |
||||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
# 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 |
# You can modify it under the terms of the GNU LESSER |
||||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
# |
# |
||||
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# 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 |
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
# (AGPL v3) along with this program. |
# (LGPL v3) along with this program. |
||||
# If not, see <http://www.gnu.org/licenses/>. |
# If not, see <http://www.gnu.org/licenses/>. |
||||
# |
# |
||||
############################################################################### |
############################################################################. |
||||
{ |
{ |
||||
"name": "Employee Late Check-in", |
'name': 'Employee Late Check-in', |
||||
"version": "16.0.1.0.1", |
'version': '16.0.1.0.0', |
||||
"category": "Human Resources", |
'category': 'Human Resources', |
||||
"summary": "Employee Late Check-in module for tracking and managing late " |
'summary': 'Employee Late Check-in module for tracking and managing late ' |
||||
"check-ins of employees and may deduct salary from payslip", |
'check-ins of employees and may deduct salary from payslip', |
||||
"description": "The module is designed for meticulous tracking and " |
'description': 'The module is designed for meticulous tracking and ' |
||||
"management of employee punctuality. It enables " |
'management of employee punctuality. It enables ' |
||||
"organizations to monitor late check-ins efficiently, " |
'organizations to monitor late check-ins efficiently, ' |
||||
"offering insights into tardiness patterns. With a " |
'offering insights into tardiness patterns. With a ' |
||||
"user-friendly interface, it provides a comprehensive " |
'user-friendly interface, it provides a comprehensive ' |
||||
"overview of individual employee records, facilitating " |
'overview of individual employee records, facilitating ' |
||||
"timely interventions. This module contributes to fostering" |
'timely interventions. This module contributes to fostering' |
||||
" a punctual and efficient work environment.", |
' a punctual and efficient work environment.', |
||||
"author": "Cybrosys Techno Solutions", |
'author': "Cybrosys Techno Solutions", |
||||
"company": "Cybrosys Techno Solutions", |
'company': 'Cybrosys Techno Solutions', |
||||
"maintainer": "Cybrosys Techno Solutions", |
'maintainer': 'Cybrosys Techno Solutions', |
||||
"website": "https://www.cybrosys.com", |
'website': 'https://www.cybrosys.com', |
||||
"depends": ["hr_attendance", "hr_payroll_community"], |
'depends': ['hr_attendance', 'hr_payroll_community', 'hr_contract_types'], |
||||
"data": [ |
'data': [ |
||||
"security/ir.model.access.csv", |
'security/ir.model.access.csv', |
||||
"data/ir_cron_data.xml", |
'data/ir_cron_data.xml', |
||||
"data/salary_rule.xml", |
'data/salary_rule.xml', |
||||
"views/res_config_settings_views.xml", |
'views/res_config_settings_views.xml', |
||||
"views/hr_attendance_views.xml", |
'views/hr_attendance_views.xml', |
||||
"views/late_check_in_views.xml", |
'views/late_check_in_views.xml', |
||||
"views/hr_employee_views.xml", |
'views/hr_employee_views.xml', |
||||
"views/hr_payslip_views.xml", |
'views/hr_payslip_views.xml', |
||||
], |
], |
||||
"images": ["static/description/banner.png"], |
'images': ['static/description/banner.png'], |
||||
"license": "AGPL-3", |
'license': 'LGPL-3', |
||||
"installable": True, |
'installable': True, |
||||
"auto_install": False, |
'auto_install': False, |
||||
"application": False, |
'application': False, |
||||
"post_init_hook": "post_init_hook" |
|
||||
} |
} |
||||
|
@ -1,56 +1,51 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################### |
############################################################################# |
||||
# |
# |
||||
# Cybrosys Technologies Pvt. Ltd. |
# Cybrosys Technologies Pvt. Ltd. |
||||
# |
# |
||||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
# 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 |
# You can modify it under the terms of the GNU LESSER |
||||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
# |
# |
||||
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# 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 |
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
# (AGPL v3) along with this program. |
# (LGPL v3) along with this program. |
||||
# If not, see <http://www.gnu.org/licenses/>. |
# If not, see <http://www.gnu.org/licenses/>. |
||||
# |
# |
||||
############################################################################### |
############################################################################. |
||||
from odoo import fields, models, _ |
from odoo import _, fields, models |
||||
|
|
||||
|
|
||||
class HrEmployee(models.Model): |
class HrEmployee(models.Model): |
||||
"""Inherit the model to add fields and methods""" |
"""Inherit the model to add fields and methods""" |
||||
|
_inherit = 'hr.employee' |
||||
_inherit = "hr.employee" |
|
||||
|
|
||||
late_check_in_count = fields.Integer( |
late_check_in_count = fields.Integer( |
||||
string="Late Check-In", |
string="Late Check-In", compute="_compute_late_check_in_count", |
||||
compute="_compute_late_check_in_count", |
help="Count of employee's late checkin") |
||||
help="Count of employee's late checkin", |
|
||||
) |
|
||||
|
|
||||
def action_to_open_late_check_in_records(self): |
def action_to_open_late_check_in_records(self): |
||||
""" |
""" |
||||
:return: dictionary defining the action to open the late check-in |
:return: dictionary defining the action to open the late check-in |
||||
records window. |
records window. |
||||
:rtype: dict |
:rtype: dict |
||||
""" |
""" |
||||
return { |
return { |
||||
"name": _("Employee Late Check-in"), |
'name': _('Employee Late Check-in'), |
||||
"domain": [("employee_id", "=", self.id)], |
'domain': [('employee_id', '=', self.id)], |
||||
"res_model": "late.check.in", |
'res_model': 'late.check.in', |
||||
"type": "ir.actions.act_window", |
'type': 'ir.actions.act_window', |
||||
"view_mode": "tree,form", |
'view_mode': 'tree,form', |
||||
"limit": 80, |
'limit': 80} |
||||
} |
|
||||
|
|
||||
def _compute_late_check_in_count(self): |
def _compute_late_check_in_count(self): |
||||
"""Compute the late check-in count""" |
"""Compute the late check-in count""" |
||||
for rec in self: |
for rec in self: |
||||
rec.late_check_in_count = self.env["late.check.in"].search_count( |
rec.late_check_in_count = self.env['late.check.in'].search_count( |
||||
[("employee_id", "=", rec.id)] |
[('employee_id', '=', rec.id)]) |
||||
) |
|
||||
|
@ -1,56 +1,52 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################### |
############################################################################# |
||||
# |
# |
||||
# Cybrosys Technologies Pvt. Ltd. |
# Cybrosys Technologies Pvt. Ltd. |
||||
# |
# |
||||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
# 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 |
# You can modify it under the terms of the GNU LESSER |
||||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
# |
# |
||||
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# 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 |
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
# (AGPL v3) along with this program. |
# (LGPL v3) along with this program. |
||||
# If not, see <http://www.gnu.org/licenses/>. |
# If not, see <http://www.gnu.org/licenses/>. |
||||
# |
# |
||||
############################################################################### |
############################################################################. |
||||
from odoo import fields, models, _ |
from odoo import _, fields, models |
||||
|
|
||||
|
|
||||
class HrEmployees(models.Model): |
class HrEmployees(models.Model): |
||||
"""Inherit the model to add fields and functions""" |
"""Inherit the model to add fields and functions""" |
||||
|
_inherit = 'hr.employee.public' |
||||
_inherit = "hr.employee.public" |
|
||||
|
|
||||
late_check_in_count = fields.Integer( |
late_check_in_count = fields.Integer( |
||||
string="Late Check-In", |
string="Late Check-In", compute="_compute_late_check_in_count", |
||||
compute="_compute_late_check_in_count", |
help="Count of employee's late checkin") |
||||
help="Count of employee's late checkin", |
|
||||
) |
|
||||
|
|
||||
def action_to_open_late_check_in_records(self): |
def action_to_open_late_check_in_records(self): |
||||
""" |
""" |
||||
:return: dictionary defining the action to open the late check-in |
:return: dictionary defining the action to open the late check-in |
||||
records window. |
records window. |
||||
:rtype: dict |
:rtype: dict |
||||
""" |
""" |
||||
return { |
return { |
||||
"name": _("Employee Late Check-in"), |
'name': _('Employee Late Check-in'), |
||||
"domain": [("employee_id", "=", self.id)], |
'domain': [('employee_id', '=', self.id)], |
||||
"res_model": "late.check.in", |
'res_model': 'late.check.in', |
||||
"type": "ir.actions.act_window", |
'type': 'ir.actions.act_window', |
||||
"view_mode": "tree,form", |
'view_mode': 'tree,form', |
||||
"limit": 80, |
'limit': 80, |
||||
} |
} |
||||
|
|
||||
def _compute_late_check_in_count(self): |
def _compute_late_check_in_count(self): |
||||
"""Compute the late check-in count""" |
"""Compute the late check-in count""" |
||||
for rec in self: |
for rec in self: |
||||
rec.late_check_in_count = self.env["late.check.in"].search_count( |
rec.late_check_in_count = self.env['late.check.in'].search_count( |
||||
[("employee_id", "=", rec.id)] |
[('employee_id', '=', rec.id)]) |
||||
) |
|
||||
|
@ -1,87 +1,73 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################### |
############################################################################# |
||||
# |
# |
||||
# Cybrosys Technologies Pvt. Ltd. |
# Cybrosys Technologies Pvt. Ltd. |
||||
# |
# |
||||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
# 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 |
# You can modify it under the terms of the GNU LESSER |
||||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
# |
# |
||||
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# 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 |
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
# (AGPL v3) along with this program. |
# (LGPL v3) along with this program. |
||||
# If not, see <http://www.gnu.org/licenses/>. |
# If not, see <http://www.gnu.org/licenses/>. |
||||
# |
# |
||||
############################################################################### |
############################################################################. |
||||
from odoo import api, fields, models |
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
class LateCheckIn(models.Model): |
class LateCheckIn(models.Model): |
||||
"""Model to store late check-in records""" |
"""Model to store late check-in records""" |
||||
|
_name = 'late.check.in' |
||||
_name = "late.check.in" |
_description = 'Late Check In' |
||||
_description = "Late Check In" |
|
||||
|
|
||||
name = fields.Char( |
name = fields.Char( |
||||
readonly=True, string="Name", help="Reference number of the record" |
readonly=True, string='Name', help="Reference number of the record") |
||||
) |
employee_id = fields.Many2one('hr.employee', string="Employee", |
||||
employee_id = fields.Many2one( |
help='Late employee') |
||||
"hr.employee", string="Employee", help="Late employee" |
late_minutes = fields.Integer(string="Late Minutes", |
||||
) |
help='The field indicates the number of ' |
||||
late_minutes = fields.Integer( |
'minutes the worker is late.') |
||||
string="Late Minutes", |
date = fields.Date(string="Date", help='Current date') |
||||
help="The field indicates the number of minutes the worker is late.", |
penalty_amount = fields.Float(compute="_compute_penalty_amount", |
||||
) |
help='Amount needs to be deducted', |
||||
date = fields.Date(string="Date", help="Current date") |
string="Amount",) |
||||
penalty_amount = fields.Float( |
state = fields.Selection(selection=[('draft', 'Draft'), |
||||
compute="_compute_penalty_amount", |
('approved', 'Approved'), |
||||
help="Amount needs to be deducted", |
('refused', 'Refused'), |
||||
string="Amount", |
('deducted', 'Deducted')], |
||||
) |
string="State", default="draft", |
||||
state = fields.Selection( |
help='State of the record') |
||||
selection=[ |
attendance_id = fields.Many2one('hr.attendance', string='Attendance', |
||||
("draft", "Draft"), |
help='Attendance of the employee') |
||||
("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 |
@api.model |
||||
def create(self, vals_list): |
def create(self, vals_list): |
||||
"""Create a sequence for the model""" |
"""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) |
return super(LateCheckIn, self.sudo()).create(vals_list) |
||||
|
|
||||
def _compute_penalty_amount(self): |
def _compute_penalty_amount(self): |
||||
"""Compute the penalty amount if the employee was late""" |
"""Compute the penalty amount if the employee was late""" |
||||
for rec in self: |
for rec in self: |
||||
amount = float( |
amount = float(self.env['ir.config_parameter'].sudo().get_param( |
||||
self.env["ir.config_parameter"].sudo().get_param("employee_late_check_in.deduction_amount") |
'employee_late_check_in.deduction_amount')) |
||||
) |
|
||||
rec.penalty_amount = amount |
rec.penalty_amount = amount |
||||
if ( |
if self.env['ir.config_parameter'].sudo().get_param( |
||||
self.env["ir.config_parameter"].sudo().get_param("employee_late_check_in.deduction_type") |
'employee_late_check_in.deduction_type') == 'minutes': |
||||
== "minutes" |
|
||||
): |
|
||||
rec.penalty_amount = amount * rec.late_minutes |
rec.penalty_amount = amount * rec.late_minutes |
||||
|
|
||||
def approve(self): |
def approve(self): |
||||
"""Change state to approved when approve button clicks""" |
"""Change state to approved when approve button clicks""" |
||||
self.state = "approved" |
self.state = 'approved' |
||||
|
|
||||
def reject(self): |
def reject(self): |
||||
"""Change state refused when refuse button clicks""" |
"""Change state refused when refuse button clicks""" |
||||
self.state = "refused" |
self.state = 'refused' |
||||
|
@ -1,52 +1,45 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################### |
############################################################################# |
||||
# |
# |
||||
# Cybrosys Technologies Pvt. Ltd. |
# Cybrosys Technologies Pvt. Ltd. |
||||
# |
# |
||||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
# 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 |
# You can modify it under the terms of the GNU LESSER |
||||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
# |
# |
||||
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# 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 |
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
# (AGPL v3) along with this program. |
# (LGPL v3) along with this program. |
||||
# If not, see <http://www.gnu.org/licenses/>. |
# If not, see <http://www.gnu.org/licenses/>. |
||||
# |
# |
||||
############################################################################### |
############################################################################. |
||||
from odoo import fields, models |
from odoo import fields, models |
||||
|
|
||||
|
|
||||
class ResCompany(models.Model): |
class ResCompany(models.Model): |
||||
"""Inherit the model to add fields""" |
"""Inherit the model to add fields""" |
||||
|
_inherit = 'res.company' |
||||
_inherit = "res.company" |
|
||||
|
|
||||
deduction_amount = fields.Float( |
deduction_amount = fields.Float( |
||||
help="How much amount need to be deducted if a employee was late", |
help='How much amount need to be deducted if a employee was late', |
||||
string="Deduction Amount", |
string="Deduction Amount",) |
||||
) |
|
||||
currency_id = fields.Many2one( |
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( |
maximum_minutes = fields.Char( |
||||
help="Maximum time limit a employee was considered as late", |
help="Maximum time limit a employee was considered as late", |
||||
string="Maximum Late Minute", |
string="Maximum Late Minute") |
||||
) |
|
||||
late_check_in_after = fields.Char( |
late_check_in_after = fields.Char( |
||||
help="When should the late check-in count down starts.", |
help='When should the late check-in count down starts.', |
||||
string="Late Check-in Starts After", |
string="Late Check-in Starts After",) |
||||
) |
|
||||
deduction_type = fields.Selection( |
deduction_type = fields.Selection( |
||||
selection=[("minutes", "Per Minutes"), ("total", "Per Total")], |
selection=[('minutes', 'Per Minutes'), ('total', 'Per Total')], |
||||
default="minutes", |
default="minutes", string='Deduction Type', |
||||
string="Deduction Type", |
help='Type of deduction, (If Per Minutes is chosen then for each ' |
||||
help="Type of deduction, (If Per Minutes is chosen then for each " |
'minutes given amount is deducted, if Per Total is chosen then ' |
||||
"minutes given amount is deducted, if Per Total is chosen then " |
'given amount is deducted from the total salary)') |
||||
"given amount is deducted from the total salary)", |
|
||||
) |
|
||||
|
@ -1,56 +1,49 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################### |
############################################################################# |
||||
# |
# |
||||
# Cybrosys Technologies Pvt. Ltd. |
# Cybrosys Technologies Pvt. Ltd. |
||||
# |
# |
||||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
# 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 |
# You can modify it under the terms of the GNU LESSER |
||||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
# |
# |
||||
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# 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 |
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
# (AGPL v3) along with this program. |
# (LGPL v3) along with this program. |
||||
# If not, see <http://www.gnu.org/licenses/>. |
# If not, see <http://www.gnu.org/licenses/>. |
||||
# |
# |
||||
############################################################################### |
############################################################################. |
||||
from odoo import fields, models |
from odoo import fields, models |
||||
|
|
||||
|
|
||||
class LateCheckinSettings(models.TransientModel): |
class LateCheckinSettings(models.TransientModel): |
||||
"""Inherit the model to add fields""" |
"""Inherit the model to add fields""" |
||||
|
_inherit = 'res.config.settings' |
||||
_inherit = "res.config.settings" |
|
||||
|
|
||||
deduction_amount = fields.Float( |
deduction_amount = fields.Float( |
||||
config_parameter="employee_late_check_in.deduction_amount", |
config_parameter='employee_late_check_in.deduction_amount', |
||||
help="How much amount need to be deducted if a employee was late", |
help='How much amount need to be deducted if a employee was late', |
||||
string="Deduction Amount", |
string="Deduction Amount",) |
||||
) |
|
||||
maximum_minutes = fields.Char( |
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", |
help="Maximum time limit a employee was considered as late", |
||||
string="Maximum Late Minute", |
string="Maximum Late Minute") |
||||
) |
|
||||
late_check_in_after = fields.Char( |
late_check_in_after = fields.Char( |
||||
config_parameter="employee_late_check_in.late_check_in_after", |
config_parameter='employee_late_check_in.late_check_in_after', |
||||
help="When should the late check-in count down starts.", |
help='When should the late check-in count down starts.', |
||||
string="Late Check-in Starts After", |
string="Late Check-in Starts After",) |
||||
) |
|
||||
deduction_type = fields.Selection( |
deduction_type = fields.Selection( |
||||
selection=[("minutes", "Per Minutes"), ("total", "Per Total")], |
selection=[('minutes', 'Per Minutes'), ('total', 'Per Total')], |
||||
config_parameter="employee_late_check_in.deduction_type", |
config_parameter='employee_late_check_in.deduction_type', |
||||
default="minutes", |
default="minutes", string='Deduction Type', |
||||
string="Deduction Type", |
help='Type of deduction, (If Per Minutes is chosen then for each ' |
||||
help="Type of deduction, (If Per Minutes is chosen then for each " |
'minutes given amount is deducted, if Per Total is chosen then ' |
||||
"minutes given amount is deducted, if Per Total is chosen then " |
'given amount is deducted from the total salary)') |
||||
"given amount is deducted from the total salary)", |
|
||||
) |
|
||||
currency_id = fields.Many2one( |
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) |
||||
) |
|
||||
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 310 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 733 B |
Before Width: | Height: | Size: 911 B After Width: | Height: | Size: 911 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 878 B After Width: | Height: | Size: 878 B |
Before Width: | Height: | Size: 653 B After Width: | Height: | Size: 653 B |
Before Width: | Height: | Size: 905 B After Width: | Height: | Size: 905 B |
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 839 B |
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 627 B After Width: | Height: | Size: 627 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 988 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 589 B After Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 967 B After Width: | Height: | Size: 967 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 215 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 273 KiB After Width: | Height: | Size: 273 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |