

def vehicle():
    '\n        RESTful CRUD controller\n        Filtered version of the asset_asset resource\n    '
    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())
    VEHICLE = s3db.asset_types['VEHICLE']
    field = table.type
    field.default = VEHICLE
    field.readable = False
    field.writable = False
    s3.filter = (field == VEHICLE)
    list_fields = s3db.get_config('asset_asset', 'list_fields')
    if ('type' in list_fields):
        tablename.remove('type')
    field = table.item_id
    field.label = T('Vehicle Type')
    field.comment = S3PopupLink(f='item', 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."))
    table.organisation_id.comment[0].vars = dict(parent='vehicle')
    field.widget = None
    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)
    table.sn.label = T('License Plate')
    s3db.asset_log.room_id.label = T('Parking Area')
    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'))
    return s3db.asset_controller()

dataset/ETHPy150Open sahana/eden/controllers/vehicle.py vehicle/VarMisuse@162/279 `list_fields`->`tablename`