Item groups to project template.

This commit is contained in:
rocketdebris 2026-02-10 15:32:49 -05:00
parent b0a5ddfbed
commit 82e8086436
2 changed files with 16 additions and 8 deletions

View file

@ -5,8 +5,8 @@
"company": "Sprinklers Northwest", "company": "Sprinklers Northwest",
"docstatus": 0, "docstatus": 0,
"doctype": "Project Template", "doctype": "Project Template",
"item_groups": null, "item_groups": "SNW-I, SNW-S, SNW-LS",
"modified": "2026-01-29 09:51:46.681553", "modified": "2026-02-10 10:29:37.435176",
"name": "SNW Install", "name": "SNW Install",
"project_type": "External", "project_type": "External",
"tasks": [ "tasks": [

View file

@ -725,15 +725,23 @@ def create_project_templates():
"""Create default Project Templates if they do not exist.""" """Create default Project Templates if they do not exist."""
print("\n🔧 Checking for default Project Templates...") print("\n🔧 Checking for default Project Templates...")
templates = { templates = {
"snw_templates": [ "Sprinklers Northwest": [
{ {
"name": "SNW Install", "name": "SNW Install",
"project_type": "Service", "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(): def create_bid_meeting_note_form_templates():