diff --git a/fusion_plating/fusion_plating_jobs/__manifest__.py b/fusion_plating/fusion_plating_jobs/__manifest__.py index 9119b765..d6fffc88 100644 --- a/fusion_plating/fusion_plating_jobs/__manifest__.py +++ b/fusion_plating/fusion_plating_jobs/__manifest__.py @@ -3,7 +3,7 @@ # License OPL-1 (Odoo Proprietary License v1.0) { 'name': 'Fusion Plating — Native Jobs', - 'version': '19.0.8.20.6', + 'version': '19.0.8.20.7', 'category': 'Manufacturing/Plating', 'summary': 'Native plating job model — replaces mrp.production / mrp.workorder bridge.', 'author': 'Nexa Systems Inc.', diff --git a/fusion_plating/fusion_plating_jobs/models/fp_job_step.py b/fusion_plating/fusion_plating_jobs/models/fp_job_step.py index d60cbc57..ac78eb7a 100644 --- a/fusion_plating/fusion_plating_jobs/models/fp_job_step.py +++ b/fusion_plating/fusion_plating_jobs/models/fp_job_step.py @@ -1135,37 +1135,21 @@ class FpJobStep(models.Model): ).sorted('sequence')[:1] if not next_step: return False - # Seed-only qty: no real incoming moves backing it. Paperwork - # step or first-step seed — bulk-move all parts in one shot. - has_real_incoming = bool( - self.incoming_move_ids.filtered( - lambda m: m.from_step_id != self - ) - ) - if not has_real_incoming: - self.env['fp.job.step.move'].create({ - 'job_id': self.job_id.id, - 'from_step_id': self.id, - 'to_step_id': next_step.id, - 'transfer_type': 'step', - 'qty_moved': qty, - 'moved_by_user_id': self.env.user.id, - }) - return True - if qty > 1: - raise UserError(_( - "Step '%s' still has %d parts here — use the row's " - "'Complete 1 → Next' button (for one-by-one flow) " - "or the 'Move…' wizard (for batched flow) to drain " - "the step before finishing." - ) % (self.name, qty)) - # qty == 1 + real incoming → record single move. + # Bulk-move all parts in one shot. Covers three use cases: + # - seed-only qty (paperwork / first step): creates the + # first explicit move record for the batch + # - real incoming, qty == 1 (streaming flow last part): + # same as Complete 1 → Next's tail call + # - real incoming, qty > 1 (batched flow): one click moves + # everything forward — operators with small parts don't + # have to click Complete 1 → Next repeatedly + # Complete 1 → Next is still available for one-by-one flow. self.env['fp.job.step.move'].create({ 'job_id': self.job_id.id, 'from_step_id': self.id, 'to_step_id': next_step.id, 'transfer_type': 'step', - 'qty_moved': 1, + 'qty_moved': qty, 'moved_by_user_id': self.env.user.id, }) return True