hr_holidays_attendance/models/hr_attendance.py

15 lines
496 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.osv.expression import AND
class HrAttendance(models.Model):
_inherit = "hr.attendance"
def _get_overtime_leave_domain(self):
domain = super()._get_overtime_leave_domain()
# resource_id = False => Public holidays
return AND([domain, ['|', ('holiday_id.holiday_status_id.time_type', '=', 'leave'), ('resource_id', '=', False)]])