fix(fusion_plating_shopfloor): partial advance blocked by from-step predecessor
The Move dialog's predecessor check flagged every unfinished step before the destination — including the from_step itself, which is in-progress by definition when advancing partial parts out of it. So any "Send → next" to a not-yet-started step showed a hard "Predecessor not done: <from_step>" blocker and greyed out SEND (reproduced on WO-30061: Racking → Ready for processing). This broke partial advance for ALL quantities, not just 1-part orders. Fix: _blockers_for_move only blocks unfinished steps STRICTLY BETWEEN from_step and to_step (you'd be skipping an incomplete intermediate stage). Immediate-next advance is allowed; skip-ahead still blocked; backward (rework) moves unblocked. Verified on entech: blocker no longer fires for Racking → Ready for processing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -124,8 +124,18 @@ class FpTabletMoveController(http.Controller):
|
||||
hasattr(to_step, '_fp_should_block_predecessors')
|
||||
and to_step._fp_should_block_predecessors()
|
||||
):
|
||||
# Partial-flow (2026-06-02): only an unfinished step STRICTLY
|
||||
# BETWEEN from_step and to_step blocks the move (you'd be skipping
|
||||
# an incomplete intermediate stage). The from_step itself is
|
||||
# in-progress BY DEFINITION when advancing partial parts out of
|
||||
# it — counting it (or any earlier step) as an "unfinished
|
||||
# predecessor" blocked every partial advance to a not-yet-started
|
||||
# next step. Steps before from_step are irrelevant: the parts
|
||||
# being moved are physically at from_step, ready for the next
|
||||
# stage. Backward moves (rework: from > to) yield an empty range
|
||||
# and are never predecessor-blocked.
|
||||
unfinished = to_step.job_id.step_ids.filtered(
|
||||
lambda s: s.sequence < to_step.sequence
|
||||
lambda s: from_step.sequence < s.sequence < to_step.sequence
|
||||
and s.state not in ('done', 'skipped', 'cancelled')
|
||||
)
|
||||
if unfinished:
|
||||
|
||||
Reference in New Issue
Block a user