37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Copyright 2026 Nexa Systems Inc.
|
|
# License OPL-1 (Odoo Proprietary License v1.0)
|
|
|
|
from odoo import models, fields, api
|
|
|
|
|
|
class HrEmployee(models.Model):
|
|
_inherit = 'hr.employee'
|
|
|
|
x_fclk_default_location_id = fields.Many2one(
|
|
'fusion.clock.location',
|
|
string='Default Clock Location',
|
|
help="The default location shown on this employee's clock page.",
|
|
)
|
|
x_fclk_enable_clock = fields.Boolean(
|
|
string='Enable Fusion Clock',
|
|
default=True,
|
|
help="If unchecked, this employee cannot use the Fusion Clock portal/systray.",
|
|
)
|
|
x_fclk_break_minutes = fields.Float(
|
|
string='Custom Break (min)',
|
|
default=0.0,
|
|
help="Override default break duration for this employee. 0 = use company default.",
|
|
)
|
|
|
|
def _get_fclk_break_minutes(self):
|
|
"""Return effective break minutes for this employee."""
|
|
self.ensure_one()
|
|
if self.x_fclk_break_minutes > 0:
|
|
return self.x_fclk_break_minutes
|
|
return float(
|
|
self.env['ir.config_parameter'].sudo().get_param(
|
|
'fusion_clock.default_break_minutes', '30'
|
|
)
|
|
)
|