@staticmethod
    def irs_vehicle_requires():

        # Vehicles are a type of Asset
        s3db = current.s3db
        table = s3db.asset_asset
        ltable = s3db.irs_ireport_vehicle
        asset_represent = s3db.asset_asset_id.represent

        # Filter to Vehicles which aren't already on a call
        # @ToDo: Filter by Org/Base
        # @ToDo: Filter out those which are under repair
        query = (table.type == s3db.asset_types["VEHICLE"]) & \
                (table.deleted == False) & \
                ((ltable.id == None) | \
                 (ltable.closed == True) | \
                 (ltable.deleted == True))
        left = ltable.on(table.id == ltable.asset_id)
        requires = IS_EMPTY_OR(IS_ONE_OF(current.db(query),
                                         "asset_asset.id",
                                         asset_represent,
                                         left=left,
                                         sort=True))
        return requires

    # -------------------------------------------------------------------------
Populate the dropdown widget for responding to an Incident Report
dataset/ETHPy150Open sahana/eden/modules/s3db/irs.py/S3IRSResponseModel.irs_vehicle_requires