Skip to content

Instantly share code, notes, and snippets.

@kholioeg
kholioeg / hr_check_working_schecdule.py
Created March 20, 2018 08:13
Odoo OpenERP gist to check the working aschedule for each employee
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