← All manuals IM2

Background Job — RO Intake (BOM → RO Inbox)

(background process — no screen)
Technical Spec Ver 1 Updated 2026-09-06 Matches the live screen

Background Job — RO Intake (source BOM → RO Inbox)

Stages material sources as RO Inbox rows. Nothing here ever creates a Requirements Order — Accept, on the RO Inbox screen, does that.

Two scripts, byte-identical to the Viktor-side originals in skills/requirements_orders/scripts/ (ro_inbox_watcher.py, ro_inbox_lines.py) and deployed to /opt/im2/app as:

app/ro_fp.py calls the same two modules from the app's manual import routes, so the screen and the watcher can never drift apart.

Trigger / schedule

Inputs

Tables written (RO database, RO_DSN)

TableWritten byContents
ro_inboxro_watch.stage()one row per (job, BOM name): source_system='FP', source_id (FP cuid), fp_job_id, fp_material_list_id, job_name, customer_name, address, bom_name, source_ref, detected_at, status='Awaiting Review', entry_source='Watcher', note.
ro_inbox_linero_parse.insert_lines()parsed lines with would_hold + plain-English hold_reason for an unknown SKU, missing/zero qty or a sheet warning; change annotations ("new line", "qty 2 → 5") when the job already has an RO.
ro_inbox (updates)ro_parseparse_error set/cleared, ro_type filled, and a row auto-marked Accepted with a note when a recheck finds no differences.

Reads only: ro_header.source_id (already promoted), im2.items (SKU validation), bt_document (BuilderTrend cache).

Other intake paths (same parser, different front door)

Failure behaviour / idempotency

Logs to look at

Known limits / gaps