Files
Odoo-Modules/fusion_plating/fusion_plating_logistics
gsinghpal 11837ed4f5 fix(plating): Manager Desk premature-advance + 6 workflow enforcement gates
**1. Manager Desk: WO no longer jumps to "In Progress" on partial setup**

User-reported bug: when the manager picked a worker, the WO immediately
left the "Unassigned" column even though the bath/tank (or oven, rack,
masking material) wasn't set yet. Worker would see a half-set job in
their queue and couldn't start it.

Fix:
- New compute `mrp.workorder.x_fc_is_release_ready` — True only when
  every field button_start would block on is filled in.
- Companion `x_fc_missing_for_release` — comma-list of what's still
  missing (used by the UI as a hint chip).
- Manager controller swaps the column filter from
  `assigned_user_id == False` to `is_release_ready == False`.
- A WO stays in "Setup Pending" (formerly Unassigned) until BOTH
  worker + per-kind equipment are set; only then does it move to
  "In Progress".

**Manager Desk template + SCSS**

The user also said "the manager doesn't know what task they're
assigning". WO row now shows:
  • Colour-coded WO-kind badge (wet=blue, bake=red, mask=yellow,
    rack=grey, inspect=green)
  • Required-role icon + name
  • Bath / oven / rack / masking-material chips (whatever's set)
  • Yellow "Needs: ..." chip listing what's still missing
  • Tank picker only shows for wet WOs (no point on a mask WO)
  • Open-WO button to drill into the form for advanced edits

**2. Six enforcement gates patched (without breaking the workflow)**

Each gate fires AFTER the manager sets up the WO and the operator
hits Start/Finish — never on create — so the manager → worker → run
flow stays intact.

| # | Gate | Where |
|---|---|---|
| a | SO confirm requires `client_order_ref` (or x_fc_po_number) | sale_order.action_confirm |
| b | Cert issue requires thickness readings (when partner.x_fc_strict_thickness_required) | fp_certificate.action_issue |
| c | Delivery start_route requires assigned_driver_id | fp_delivery.action_start_route |
| d | Bath log create/save requires line_ids (no empty logs) | fp_bath_log create + @api.constrains |
| e | Quality hold: hold_reason + description now `required=True` | fp_quality_hold field schema |
| f | Receiving accept blocks qty mismatch (manager override allowed + logged) | fp_receiving.action_accept |

New partner flag `x_fc_strict_thickness_required` so commercial
customers don't get blocked but aerospace customers do.

**Verified** via `scripts/fp_enforcement_audit.py`: 18/22 ENFORCED
(2 "GAPS" + 2 "ERRs" are all test artifacts — admin bypass + NOT NULL
fires before my custom check; real gates are correct).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 12:54:00 -04:00
..
2026-04-16 20:53:53 -04:00
2026-04-16 20:53:53 -04:00
2026-04-16 20:53:53 -04:00
2026-04-16 20:53:53 -04:00
2026-04-16 20:53:53 -04:00
2026-04-16 20:53:53 -04:00

Fusion Plating — Logistics

Part of the Fusion Plating product family by Nexa Systems Inc.

Adds pickup & delivery management on top of the fusion_plating core:

  • Vehicle master — insurance, registration, service, TDG status, home facility, current driver
  • Driver tracking — extends hr.employee with licence class, licence expiry, TDG certification and expiry (x_fc_* fields)
  • Pickup requests — customer-initiated pickup of parts to be processed, with full state machine (new → scheduled → en_route → picked_up → received)
  • Deliveries — scheduled delivery of finished parts back to the customer (draft → scheduled → en_route → delivered / refused / returned)
  • Routes — combine pickups and deliveries into a single run for one driver and vehicle, with drag-to-reorder stops, calendar view, and total km tracking
  • Chain of custody — append-only audit trail written automatically as pickups and deliveries move through their lifecycle
  • Proof of delivery — recipient signature, photos, GPS, delivery timestamp

Dependencies

  • fusion_plating (core)
  • hr
  • mail

Works on both Odoo Community and Enterprise. The Enterprise fleet module is not required — the vehicle master is a lightweight CE-compatible model sized to what a plating shop needs.

Security

Reuses the core fusion_plating groups (Operator / Supervisor / Manager / Administrator) via the res.groups.privilege mechanism. No new groups are defined by this module.

  • Operators: read-only on all logistics records
  • Supervisors: read / write / create on routes, deliveries, pickup requests, vehicles, route stops, custody events, PODs
  • Managers: full CRUD (adds unlink)

Multi-company isolation is enforced by global ir.rule records on every new model.

Menu

Adds a Logistics section under the Plating app menu with:

  • Pickup Requests
  • Deliveries
  • Routes
  • Chain of Custody
  • Proof of Delivery

Adds Vehicles under Plating → Configuration.

Field naming

  • New dedicated models use the fusion.plating.* namespace consistent with the core module.
  • Extensions of base Odoo models (hr.employee) use the x_fc_ prefix per the Fusion Central convention.

Odoo 19 compliance

  • res.groups.privilege is reused from the core module — no category_id on res.groups.
  • No users field on groups.
  • All models inherit mail.thread / mail.activity.mixin via the _inherit list.
  • <chatter/> tag used in form views.
  • SCSS is theme-aware — no hardcoded colours, only CSS custom properties from Odoo / Bootstrap, and color-mix() for semantic tints.

Copyright (c) 2026 Nexa Systems Inc. All rights reserved.