gigafibre-fsm/erpnext/add_depends_on_field.py
louispaulb 7d7b4fdb06 feat: nested tasks, project wizard, n8n webhooks, inline task editing
Major dispatch/task system overhaul:
- Project templates with 3-step wizard (choose template → edit steps → publish)
- 4 built-in templates: phone service, fiber install, move, repair
- Nested task tree with recursive TaskNode component (parent_job hierarchy)
- n8n webhook integration (on_open_webhook, on_close_webhook per task)
- Inline task editing: status, priority, type, tech assignment, tags, delete
- Tech assignment + tags from ticket modal → jobs appear on dispatch timeline
- ERPNext custom fields: parent_job, on_open_webhook, on_close_webhook, step_order
- Refactored ClientDetailPage, ChatterPanel, DetailModal, dispatch store
- CSS consolidation, dead code cleanup, composable extraction
- Dashboard KPIs with dispatch integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 13:01:20 -04:00

25 lines
771 B
Python

import frappe
def add_depends_on():
"""Add depends_on field to Dispatch Job."""
fieldname = "depends_on"
if frappe.db.exists("Custom Field", {"dt": "Dispatch Job", "fieldname": fieldname}):
print(f" Field {fieldname} already exists, skipping.")
return
frappe.get_doc({
"doctype": "Custom Field",
"dt": "Dispatch Job",
"fieldname": "depends_on",
"fieldtype": "Link",
"label": "Dépend de",
"options": "Dispatch Job",
"insert_after": "source_issue",
}).insert(ignore_permissions=True)
frappe.db.commit()
print(f" ✓ Dispatch Job.depends_on field added.")
if __name__ == "__main__":
frappe.connect(site="erp.gigafibre.ca")
add_depends_on()
frappe.destroy()