'@param employee: recordset of employee
@param date_from: date field
@param date_to: date field
@return: returns the ids of all the contracts for the given employee that need to be considered for the given dates'

@api.model
def get_contract(self, employee, date_from, date_to):

    clause_1 = ['&', ('date_end', '<=', date_to), ('date_end', '>=', date_from)]
    clause_2 = ['&', ('date_start', '<=', date_to), ('date_start', '>=', date_from)]
    clause_3 = ['&', ('date_start', '<=', date_from), '|', ('date_end', '=', False), ('date_end', '>=', date_to)]
    clause_final = ((([('employee_id', '=', employee.id), '|', '|'] + clause_1) + clause_2) + clause_3)
    return self.env['hr.contract'].search(clause_final).ids
