From 76a80badff5e76e70f6f749e3a5cef6917fed477 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Tue, 26 May 2026 21:11:15 -0400 Subject: [PATCH] feat(jobs): B3 - second hook in fp.job.action_confirm for bake step.instructions write --- fusion_plating/fusion_plating_jobs/models/fp_job.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fusion_plating/fusion_plating_jobs/models/fp_job.py b/fusion_plating/fusion_plating_jobs/models/fp_job.py index 67b8796b..cb8b638d 100644 --- a/fusion_plating/fusion_plating_jobs/models/fp_job.py +++ b/fusion_plating/fusion_plating_jobs/models/fp_job.py @@ -1685,6 +1685,18 @@ class FpJob(models.Model): ) if pending_steps: pending_steps.write({'state': 'ready'}) + + # Express Orders (2026-05-26) — second pass of the override + # helper. The first pass (in sale_order._fp_auto_create_job) + # creates override rows. Now that steps exist (just generated + # above), this pass writes Express bake_instructions to the + # bake step's `instructions` field. Idempotent: pre-deletes + # prior masking/bake overrides then recreates identical rows. + if (job.recipe_id and job.step_ids + and 'x_fc_masking_enabled' in self.env['sale.order.line']._fields): + for sol in job.sale_order_line_ids: + if hasattr(sol, '_fp_apply_express_overrides_to_job'): + sol._fp_apply_express_overrides_to_job(job) # 2026-04-28 — auto-populate facility_id + manager_id so the # job header surfaces them on the form. Page-1 audit found # both empty on confirmed jobs.