diff --git a/deploy/README.md b/deploy/README.md index 568ac2e..8778e93 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -39,6 +39,14 @@ sudo systemctl enable frappe-bench.target sudo systemctl start frappe-bench.target ``` +### Assets Symlink + +After installing the app, create the assets symlink for custom icons: + +```bash +sudo ln -sf /opt/erpnext/frappe-bench/apps/service_factory/service_factory/public /opt/erpnext/frappe-bench/sites/assets/service_factory +``` + ### Credentials Admin credentials are stored in `/root/erpnext-admin-credentials.txt`. diff --git a/service_factory/api/__init__.py b/service_factory/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/service_factory/api/permission.py b/service_factory/api/permission.py new file mode 100644 index 0000000..5013202 --- /dev/null +++ b/service_factory/api/permission.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, cclohmar and contributors +# For license information, please see license.txt + + +def has_app_permission(): + """Check if the current user has permission to see the Service Factory app icon.""" + import frappe + + # All authenticated users with at least one role can see the app icon + if frappe.session.user == "Guest": + return False + + return True diff --git a/service_factory/hooks.py b/service_factory/hooks.py index 091726e..eb34b25 100644 --- a/service_factory/hooks.py +++ b/service_factory/hooks.py @@ -11,15 +11,15 @@ app_license = "mit" # required_apps = [] # Each item in the list will be shown as an app in the apps page -# add_to_apps_screen = [ -# { -# "name": "service_factory", -# "logo": "/assets/service_factory/logo.png", -# "title": "Service Factory", -# "route": "/service_factory", -# "has_permission": "service_factory.api.permission.has_app_permission" -# } -# ] +add_to_apps_screen = [ + { + "name": "service_factory", + "logo": "/assets/service_factory/icons/service_factory.svg", + "title": "Service Factory", + "route": "/app/engineer-workspace", + "has_permission": "service_factory.api.permission.has_app_permission" + } +] # Includes in
# ------------------ diff --git a/service_factory/public/icons/service_factory.svg b/service_factory/public/icons/service_factory.svg new file mode 100644 index 0000000..1767ccc --- /dev/null +++ b/service_factory/public/icons/service_factory.svg @@ -0,0 +1,10 @@ +