fix(jobs): store=True on fp.job.active_step_id

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) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-24 17:14:19 -04:00
parent 2285c9def1
commit 056178b433

View File

@@ -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 ====