1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/hr_payroll_holidays/models/hr_contract.py
2024-12-10 09:04:09 +07:00

10 lines
417 B
Python

from odoo import models
class HrContract(models.Model):
_inherit = 'hr.contract'
def _get_resource_calendar_leaves(self, start_dt, end_dt):
# prevent leaves that are associated with a blocked payslip to be taken
# into account, as they will be deferred lated.
return super()._get_resource_calendar_leaves(start_dt, end_dt).filtered(lambda l: l.holiday_id.payslip_state != 'blocked')