This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for employee in self.env['hr.employee'].search([]): | |
current_employee = self.search([ | |
('name', '=', fields.Date.today()), | |
('employee_id', '=', employee.id) | |
]) | |
if not current_employee: | |
try: | |
contract_id = self.env['hr.contract'].browse( | |
current_employee.contract_ids[0].id) | |
resource_calendar_id = contract_id.working_hours |