def resort_client_actions(portal):
    sorted_actions = [
        "edit",
        "contacts",
        "view",
        "analysisrequests",
        "batches",
        "samplepoints",
        "profiles",
        "templates",
        "specs",
        "orders",
        "reports_listing"
    ]
    type_info = portal.portal_types.getTypeInfo("Client")
    actions = filter(lambda act: act.id in sorted_actions, type_info._actions)
    missing = filter(lambda act: act.id not in sorted_actions, type_info._actions)
    actions = sorted(actions, key=lambda act: sorted_actions.index(act.id))
    if missing:
        actions.extend(missing)
    type_info._actions = actions