This commit is contained in:
gsinghpal
2026-05-25 08:17:29 -04:00
parent 5d5964a327
commit 80887d6098
19 changed files with 117 additions and 558 deletions

View File

@@ -641,8 +641,8 @@ class FpShopfloorController(http.Controller):
# /fp/landing/kanban. The Tablet Station menu now points at the new
# surface. This endpoint stays live as long as the legacy
# fp_shopfloor_tablet OWL component is still registered — it consumes
# the rich payload (my_queue, active_wo, baths, bake_windows, gates,
# holds, pending_qcs, stations). Phase 5 cleanup will retire both the
# the rich payload (my_queue, active_wo, baths, bake_windows, holds,
# pending_qcs, stations). Phase 5 cleanup will retire both the
# legacy component and this endpoint together.
@http.route('/fp/shopfloor/tablet_overview', type='jsonrpc', auth='user')
def tablet_overview(self, station_id=None, facility_id=None):
@@ -673,7 +673,6 @@ class FpShopfloorController(http.Controller):
Step = env['fp.job.step']
BakeWindow = env['fusion.plating.bake.window']
Gate = env['fusion.plating.first.piece.gate']
Hold = env['fusion.plating.quality.hold']
def _fac_dom(dom):
@@ -704,7 +703,6 @@ class FpShopfloorController(http.Controller):
awaiting = BakeWindow.search_count(bake_dom + [('state', '=', 'awaiting_bake')])
in_progress_bakes = BakeWindow.search_count(bake_dom + [('state', '=', 'bake_in_progress')])
missed = BakeWindow.search_count(bake_dom + [('state', '=', 'missed_window')])
pending_gates = Gate.search_count(_fac_dom([('result', '=', 'pending')]))
hold_dom = [('state', 'in', ('on_hold', 'under_review'))]
if my_job_ids_for_kpi and 'x_fc_job_id' in Hold._fields:
hold_dom.append(('x_fc_job_id', 'in', my_job_ids_for_kpi))
@@ -715,7 +713,6 @@ class FpShopfloorController(http.Controller):
{'label': 'In Progress', 'value': steps_progress, 'tone': 'success', 'icon': 'fa-cogs'},
{'label': 'Awaiting Bake', 'value': awaiting, 'tone': 'warning', 'icon': 'fa-fire'},
{'label': 'Missed Windows', 'value': missed, 'tone': 'danger' if missed else 'muted', 'icon': 'fa-exclamation-triangle'},
{'label': 'First-Piece', 'value': pending_gates, 'tone': 'info', 'icon': 'fa-flag-checkered'},
{'label': 'Quality Holds', 'value': open_holds, 'tone': 'danger' if open_holds else 'muted', 'icon': 'fa-pause-circle'},
]
@@ -873,23 +870,6 @@ class FpShopfloorController(http.Controller):
for bw in bws
]
# -- First-piece gates -------------------------------------------
gate_domain = _fac_dom([('result', 'in', ('pending', 'fail'))])
gates = Gate.search(gate_domain, order='first_piece_produced desc', limit=6)
gates_data = [
{
'id': g.id,
'name': g.name,
'part_ref': g.part_ref or '',
'customer': g.customer_ref or '',
'bath': g.bath_id.name or '',
'result': g.result,
'first_piece': fp_format(request.env, g.first_piece_produced),
'inspector': g.inspector_id.name or '',
}
for g in gates
]
# -- Quality holds -----------------------------------------------
# v19.0.24.3.0 — scope holds to operator's jobs so Carlos's
# sidebar isn't flooded with plant-wide HOLD-XXXX from other
@@ -986,7 +966,6 @@ class FpShopfloorController(http.Controller):
'active_wo': active_wo,
'baths': baths_data,
'bake_windows': bw_data,
'gates': gates_data,
'holds': holds_data,
'pending_qcs': pending_qcs,
'stations': stations,
@@ -1007,26 +986,6 @@ class FpShopfloorController(http.Controller):
})
return {'ok': True}
# ----------------------------------------------------------------------
# Mark a first-piece gate result from the tablet
# ----------------------------------------------------------------------
@http.route('/fp/shopfloor/mark_gate', type='jsonrpc', auth='user')
def mark_gate(self, gate_id, result):
env = request.env
gate = env['fusion.plating.first.piece.gate'].browse(int(gate_id))
if not gate.exists():
return {'ok': False, 'error': 'Gate not found.'}
try:
if result == 'pass':
gate.action_mark_pass()
elif result == 'fail':
gate.action_mark_fail()
else:
return {'ok': False, 'error': f'Unknown result {result}'}
except UserError as e:
return {'ok': False, 'error': str(e.args[0]) if e.args else str(e)}
return {'ok': True, 'state': gate.result}
# ----------------------------------------------------------------------
# Operator queue snapshot (legacy fusion.plating.operator.queue helper)
# ----------------------------------------------------------------------
@@ -1403,7 +1362,6 @@ class FpShopfloorController(http.Controller):
'due_today': 25,
'priority': 20,
'due_soon': 15,
'first_piece': 10,
'normal': 0,
}