From 056178b43324f33c3350719e84ef68b75baae1bf Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 24 May 2026 17:14:19 -0400 Subject: [PATCH] fix(jobs): store=True on fp.job.active_step_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Required because fp.job.card_state (stored) has @api.depends including active_step_id.area_kind. When step.area_kind changes, Odoo's trigger chain searches fp.job by active_step_id — non-stored fields can't be queried in WHERE clauses, raising ValueError("Cannot convert ... to SQL because it is not stored"). Caught during entech deploy of 19.0.10.25.0/post-migrate.py Phase 3 (steps._compute_area_kind() failed on first run). store=True makes the column searchable and the trigger chain works. Co-Authored-By: Claude Opus 4.7 (1M context) --- fusion_plating/fusion_plating_jobs/models/fp_job.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fusion_plating/fusion_plating_jobs/models/fp_job.py b/fusion_plating/fusion_plating_jobs/models/fp_job.py index 1b97c46f..6514a1ec 100644 --- a/fusion_plating/fusion_plating_jobs/models/fp_job.py +++ b/fusion_plating/fusion_plating_jobs/models/fp_job.py @@ -144,9 +144,14 @@ class FpJob(models.Model): active_step_id = fields.Many2one( 'fp.job.step', compute='_compute_active_step_id', + store=True, + index=True, string='Active Step', - help='Currently in-progress step (lowest sequence if multiple — ' - 'defensive). Drives JobWorkspace landing focus.', + help='Currently the live step under the priority chain ' + '(in_progress > paused > ready > pending). Drives ' + 'JobWorkspace landing focus + card_state. Stored so ' + 'card_state\'s `active_step_id.area_kind` dependency ' + 'can search back to dependent jobs without erroring.', ) # ===== 2026-05-23 Plant-view kanban — card_state + mini_timeline ====