diff --git a/custom_ui/fixtures/project_template.json b/custom_ui/fixtures/project_template.json index c0fc39b..04cbc5d 100644 --- a/custom_ui/fixtures/project_template.json +++ b/custom_ui/fixtures/project_template.json @@ -5,8 +5,8 @@ "company": "Sprinklers Northwest", "docstatus": 0, "doctype": "Project Template", - "item_groups": null, - "modified": "2026-01-29 09:51:46.681553", + "item_groups": "SNW-I, SNW-S, SNW-LS", + "modified": "2026-02-10 10:29:37.435176", "name": "SNW Install", "project_type": "External", "tasks": [ diff --git a/custom_ui/install.py b/custom_ui/install.py index df8a186..784076b 100644 --- a/custom_ui/install.py +++ b/custom_ui/install.py @@ -725,15 +725,23 @@ def create_project_templates(): """Create default Project Templates if they do not exist.""" print("\n🔧 Checking for default Project Templates...") templates = { - "snw_templates": [ + "Sprinklers Northwest": [ { "name": "SNW Install", "project_type": "Service", - "company": "Sprinklers Northwest", - "calendar_color": "#FF5733" # Example color - } - ] - } + "calendar_color": "#FF5733", # Example color + "item_groups": "SNW-I, SNW-S, SNW-LS" + } + ] + } + + for company, template_list in templates.items(): + for template in template_list: + if frappe.db.exists("Project Template", template["name"]): + continue + + doc = frappe.get_doc(template) + doc.insert(ignore_permissions=True) def create_bid_meeting_note_form_templates():