mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] hr_payroll_overtime: implement exempt from overtime on contract
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from . import hr_contract
|
||||
from . import hr_payslip
|
||||
from . import hr_work_entry
|
||||
from . import resource_calendar
|
||||
|
||||
8
hr_payroll_overtime/models/hr_contract.py
Normal file
8
hr_payroll_overtime/models/hr_contract.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class HrContract(models.Model):
|
||||
_inherit = 'hr.contract'
|
||||
|
||||
is_overtime_exempt = fields.Boolean(string='Overtime Exempt',
|
||||
help='e.g. Agriculture or farm work exempt under the US FLSA.')
|
||||
@@ -105,7 +105,7 @@ class HRPayslip(models.Model):
|
||||
working_aggregation[work_type][2] = multiplier
|
||||
|
||||
week = iso_date[1]
|
||||
if work_type.overtime_work_type_id and work_type.overtime_type_id:
|
||||
if not self.contract_id.is_overtime_exempt and work_type.overtime_work_type_id and work_type.overtime_type_id:
|
||||
ot_h_w = work_type.overtime_type_id.hours_per_week
|
||||
ot_h_d = work_type.overtime_type_id.hours_per_day
|
||||
|
||||
|
||||
Reference in New Issue
Block a user