def item():

    if "catalog_item" not in request.args:
        # Filter to just Assets
        table = s3db.supply_item
        ctable = s3db.supply_item_category
        s3.filter = (table.item_category_id == ctable.id) & \
                    (ctable.can_be_asset == True)

        # Limit the Categories to just those which can be Assets
        # - make category mandatory so that filter works
        field = s3db.supply_item.item_category_id
        field.requires = IS_ONE_OF(db,
                                   "supply_item_category.id",
                                   s3db.supply_item_category_represent,
                                   filterby = "can_be_asset",
                                   filter_opts = (True,),
                                   sort = True,
                                   )

        field.comment = S3PopupLink(f="item_category",
                                    label=T("Create Item Category"),
                                    title=T("Item Category"),
                                    tooltip=T("Only Categories of type 'Asset' will be seen in the dropdown."))

    # Defined in the Model for use from Multiple Controllers for unified menus
    return s3db.supply_item_controller()

# -----------------------------------------------------------------------------
RESTful CRUD controller
dataset/ETHPy150Open sahana/eden/controllers/asset.py/item