refactor(jobs): address code review feedback on fp.job.step (Task 1.6)
- I1: Replace 'Task 1.6' markers in stub method comments and
NotImplementedError messages with forward-looking phrasing.
Task 1.6 is what just shipped (the field expansion); the action
stubs are deferred to an unspecified future task. Stale markers
would have confused future readers/operators.
- I2: Add test_cost_total_recomputes_when_rate_changes — insurance
test that verifies @api.depends('cost_per_hour') triggers through
the related-from-work_centre chain. Catches future Odoo upgrades
that break related-depends.
Manifest 19.0.8.5.0 → 19.0.8.5.1.
Part of: native job model migration (spec 2026-04-25)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -158,31 +158,31 @@ class FpJobStep(models.Model):
|
||||
# ------------------------------------------------------------------
|
||||
# Implemented: button_start (ready/paused → in_progress),
|
||||
# button_finish (in_progress → done).
|
||||
# Stubs (raise NotImplementedError for Task 1.6):
|
||||
# Stubs (raise NotImplementedError; wiring deferred):
|
||||
# button_pause (in_progress → paused)
|
||||
# button_resume (covered by button_start when state='paused')
|
||||
# button_skip (pending/ready → skipped)
|
||||
# button_cancel (any non-done → cancelled)
|
||||
# Predecessor-driven transition pending → ready will land in
|
||||
# Task 1.6 along with first-step / dependency wiring.
|
||||
# Predecessor-driven transition pending → ready will be wired
|
||||
# alongside first-step / dependency logic in a future task.
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
def button_pause(self):
|
||||
raise NotImplementedError(_(
|
||||
"button_pause lands in Task 1.6 (operator pause / break / "
|
||||
"button_pause is not yet implemented (operator pause / break / "
|
||||
"end-of-shift). Use button_finish to complete a step or set "
|
||||
"state directly via privileged code."
|
||||
))
|
||||
|
||||
def button_skip(self):
|
||||
raise NotImplementedError(_(
|
||||
"button_skip lands in Task 1.6 (skip an opt-in step that "
|
||||
"button_skip is not yet implemented (skip an opt-in step that "
|
||||
"wasn't activated for this job)."
|
||||
))
|
||||
|
||||
def button_cancel(self):
|
||||
raise NotImplementedError(_(
|
||||
"button_cancel lands in Task 1.6 (cancelling a single step; "
|
||||
"button_cancel is not yet implemented (cancelling a single step; "
|
||||
"cancelling the whole job runs through fp.job.action_cancel)."
|
||||
))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user