diff --git a/AGENTS.md b/AGENTS.md index 8129540..d833cab 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # Service Factory — ERPNext Custom App Project -> **Current Version: V0.1.0011** — Each completed prompt/step increments the patch number by 1 (V0.1.0000 → V0.1.0001 → V0.1.0002…). The agent automatically commits and pushes after every step. +> **Current Version: V0.1.0012** — Each completed prompt/step increments the patch number by 1 (V0.1.0000 → V0.1.0001 → V0.1.0002…). The agent automatically commits and pushes after every step. ## Project Overview diff --git a/service_factory/service_factory/api/permission.py b/service_factory/service_factory/api/permission.py index e6d320c..f2e39e7 100644 --- a/service_factory/service_factory/api/permission.py +++ b/service_factory/service_factory/api/permission.py @@ -1,12 +1,31 @@ # Copyright (c) 2026, cclohmar and contributors # For license information, please see license.txt +import frappe + def has_app_permission(): """Check if the current user has permission to see the Service Factory app icon.""" - import frappe - if frappe.session.user == "Guest": return False return True + + +def create_desktop_icon(): + """Ensure the Service Factory Desktop Icon exists after migrate.""" + if frappe.db.exists("Desktop Icon", {"app": "service_factory"}): + return + + icon = frappe.new_doc("Desktop Icon") + icon.label = "Service Factory" + icon.app = "service_factory" + icon.icon_type = "App" + icon.link = "/app/engagement-board" + icon.logo_url = "/assets/service_factory/icons/service_factory.svg" + icon.standard = 1 + icon.hidden = 0 + icon.idx = 50 + icon.save(ignore_permissions=True) + frappe.db.commit() + print("✅ Service Factory Desktop Icon created (after_migrate)") diff --git a/service_factory/service_factory/fixtures/desktop_icon.json b/service_factory/service_factory/fixtures/desktop_icon.json new file mode 100644 index 0000000..70a8932 --- /dev/null +++ b/service_factory/service_factory/fixtures/desktop_icon.json @@ -0,0 +1,14 @@ +[ + { + "name": "Service Factory", + "label": "Service Factory", + "app": "service_factory", + "icon_type": "App", + "link": "/app/engagement-board", + "logo_url": "/assets/service_factory/icons/service_factory.svg", + "standard": 1, + "hidden": 0, + "idx": 50, + "doctype": "Desktop Icon" + } +] diff --git a/service_factory/service_factory/hooks.py b/service_factory/service_factory/hooks.py index 99c3e99..40c6466 100644 --- a/service_factory/service_factory/hooks.py +++ b/service_factory/service_factory/hooks.py @@ -175,6 +175,12 @@ fixtures = [ {"dt": "Engagement Task Type"}, ] +# Recreate Service Factory Desktop Icon after each migrate +# (Frappe's orphan cleanup removes it before fixtures run) +after_migrate = [ + "service_factory.api.permission.create_desktop_icon" +] + # Testing # ------- diff --git a/service_factory/service_factory/service_factory/doctype/engagement_card/engagement_card.json b/service_factory/service_factory/service_factory/doctype/engagement_card/engagement_card.json index 3f280b0..8b685af 100644 --- a/service_factory/service_factory/service_factory/doctype/engagement_card/engagement_card.json +++ b/service_factory/service_factory/service_factory/doctype/engagement_card/engagement_card.json @@ -13,8 +13,9 @@ "engine": "InnoDB", "field_order": [ "naming_series", - "card_type", - "task", + "card_type", + "status", + "task", "title", "column_break_1", "priority",