def vehicle():
    """
        RESTful CRUD controller
        Filtered version of the asset_asset resource
    """

    tablename = "asset_asset"
    table = s3db[tablename]

    s3db.configure("vehicle_vehicle",
                   deletable = False,
                   )

    set_method = s3db.set_method

    set_method("asset", "asset", method="assign",
               action = s3db.hrm_AssignMethod(component="human_resource"))

    set_method("asset", "asset", method="check-in",
               action = s3base.S3CheckInMethod())

    set_method("asset", "asset", method="check-out",
               action = s3base.S3CheckOutMethod())

    # Type is Vehicle
    VEHICLE = s3db.asset_types["VEHICLE"]
    field = table.type
    field.default = VEHICLE
    field.readable = False
    field.writable = False

    # Only show vehicles
    s3.filter = (field == VEHICLE)

    # Remove type from list_fields
    list_fields = s3db.get_config("asset_asset", "list_fields")
    if "type" in list_fields:
        list_fields.remove("type")

    field = table.item_id
    field.label = T("Vehicle Type")
    field.comment = S3PopupLink(f="item",
                                # Use this controller for options.json rather than looking for one called 'asset'
                                vars=dict(parent="vehicle"),
                                label=T("Add Vehicle Type"),
                                info=T("Add a new vehicle type"),
                                title=T("Vehicle Type"),
                                tooltip=T("Only Items whose Category are of type 'Vehicle' will be seen in the dropdown."))

    # Use this controller for options.json rather than looking for one called 'asset'
    table.organisation_id.comment[0].vars = dict(parent="vehicle")

    # Only select from vehicles
    field.widget = None # We want a simple dropdown
    ctable = s3db.supply_item_category
    itable = s3db.supply_item
    query = (ctable.is_vehicle == True) & \
            (itable.item_category_id == ctable.id)
    field.requires = IS_ONE_OF(db(query),
                               "supply_item.id",
                               "%(name)s",
                               sort=True)
    # Label changes
    table.sn.label = T("License Plate")
    s3db.asset_log.room_id.label = T("Parking Area")

    # CRUD strings
    s3.crud_strings[tablename] = Storage(
        label_create = T("Add Vehicle"),
        title_display = T("Vehicle Details"),
        title_list = T("Vehicles"),
        title_update = T("Edit Vehicle"),
        title_map = T("Map of Vehicles"),
        label_list_button = T("List Vehicles"),
        label_delete_button = T("Delete Vehicle"),
        msg_record_created = T("Vehicle added"),
        msg_record_modified = T("Vehicle updated"),
        msg_record_deleted = T("Vehicle deleted"),
        msg_list_empty = T("No Vehicles currently registered"))

    # @ToDo: Tweak the search comment

    # Defined in Model
    return s3db.asset_controller()

# =============================================================================
dataset/ETHPy150Open sahana/eden/controllers/vehicle.py/vehicle/original