How to Add a Custom App to Desktop in Frappe v16

If you want to show your custom app on the Desktop in Frappe v16, you don’t need to change any code.

Follow these steps:

1. Go to Desktop Icon
2. Create a new record for your custom app

Configure the fields:

3. Icon Type – APP
4. Link Type – External (Important)
5. Logo URL – URL of your app logo
6. Link – Page URL you want to open when clicked

7. Save and refresh the page.

Your custom app will now appear on the Desktop.

Doesn’t work; It give Session Boot Error

  1. Open the hooks.py file of your custom app.
  2. Locate the add_to_app_screen configuration.
  3. Uncomment the add_to_app_screen section.
  4. Configure it according to your requirement (app name, label, route, etc.).
  5. Run the following command:

bench migrate

bench restart

  1. Refresh the browser page (clear cache if needed).
  2. Verify that the app appears correctly on the App Screen.

@ptushar

Full solution

  1. Update your hooks.py
add_to_apps_screen = [{
    "name": "my_app",
    "logo": "/assets/my_app/logo.png", # This is the browser client path, your logo.png should be on "/my_app/my_app/public/logo.png"
    "title": "My App",
    "route": "/desk/my_app",
    "has_permission": "my_app.api.check_app_permission" # This is for check if user have access to this app, *example below
}]

2. Run this bench command

bench create-desktop-icons-and-sidebar

Example of check_app_permission

import frappe
from frappe.utils import modules

def has_app_permission() -> bool:
    """Check if the current user has permission to access the app."""
    allowed_modules = modules.get_modules_from_all_apps_for_user()
    allowed_modules = [x["module_name"] for x in allowed_modules]
    if "My app" not in allowed_modules:
        return False
    
    roles = frappe.get_roles()
    if any(role in roles for role in ["System Manager","My App Manager", "My App User", "My App Administrator"]):
        return True
    
    return False
1 Like