feat(shopfloor): Manager Desk — assign workers, swap tanks, take over (CHUNK 2/4)

New client action "Manager Desk" under Shop Floor menu (manager-only).
Three-column dashboard designed for the shop manager's daily job:

  Column 1 — Needs a Worker
    MOs with active WOs missing user assignment. Each card expands to
    show per-WO rows with:
      - Assign Worker dropdown (pulls from group_fusion_plating_operator)
      - Tank swap dropdown (all tanks with current bath)
      - Take Over (claims for the manager in one click)
      - Open (jump to WO form)

  Column 2 — In Progress
    MOs with workers actively running WOs. Shows who's on each step,
    lets manager reassign or take over if someone steps away.

  Column 3 — Team
    Avatar grid of operators with live queue + in-progress counts.
    Click to drill into that operator's full WO list.

KPI strip on top: Unassigned WOs, In Progress, Ready to Ship, Awaiting
Assignment SOs.

Quick / Detailed view toggle — Detailed auto-expands every card body.

New field mrp.workorder.x_fc_assigned_user_id (indexed, tracked) —
the worker currently owning this step. Will be the pivot the Tablet
Station filters on in Chunk 4.

Three new endpoints:
  /fp/manager/overview       — dashboard snapshot (30s auto-refresh)
  /fp/manager/assign_worker  — set user on a WO
  /fp/manager/assign_tank    — swap tank on a WO
  /fp/manager/take_over      — manager claims the WO (no-show coverage)

Controller is graceful when mrp module isn't installed (empty overview,
no crash) and when the bridge_mrp assignment field isn't present (falls
back to showing all active WOs as "unassigned").

Verified: 4 WOs assigned across 2 users, overview queries return the
expected counts, res.groups.user_ids (Odoo 19 API, not deprecated .users).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-17 20:03:01 -04:00
parent 095d9f487c
commit 1c6a460ca1
8 changed files with 856 additions and 0 deletions

View File

@@ -13,6 +13,19 @@
sequence="12"
groups="fusion_plating.group_fusion_plating_operator"/>
<!-- Manager Desk — assign workers, swap tanks, cover no-shows -->
<record id="action_fp_manager_dashboard" model="ir.actions.client">
<field name="name">Manager Desk</field>
<field name="tag">fp_manager_dashboard</field>
</record>
<menuitem id="menu_fp_shopfloor_manager"
name="Manager Desk"
parent="menu_fp_shopfloor"
action="action_fp_manager_dashboard"
sequence="3"
groups="fusion_plating.group_fusion_plating_manager"/>
<menuitem id="menu_fp_shopfloor_plant_overview"
name="Plant Overview"
parent="menu_fp_shopfloor"