gigafibre-fsm/apps/dispatch/frappe-setup/add_start_time_field.py
louispaulb 7da22ff132 merge: import dispatch-app into apps/dispatch/ (17 commits preserved)
Integrates the Dispatch PWA (Vue/Quasar) into the gigafibre-fsm monorepo.
Full git history accessible via `git log -- apps/dispatch/`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 08:08:51 -04:00

24 lines
600 B
Python

"""
Add start_time field to Dispatch Job doctype
"""
import frappe
def run():
meta = frappe.get_meta('Dispatch Job')
if meta.has_field('start_time'):
print("✓ Field 'start_time' already exists on Dispatch Job")
return
doc = frappe.get_doc('DocType', 'Dispatch Job')
doc.append('fields', {
'fieldname': 'start_time',
'fieldtype': 'Time',
'label': 'Heure de début',
'insert_after': 'scheduled_date',
})
doc.save(ignore_permissions=True)
frappe.db.commit()
print("✓ Field 'start_time' added to Dispatch Job")
run()