refactor(jobs): address code review feedback on fp.job (Task 1.4)
- Move NOTE comment from between @api.depends and the function into a proper docstring on _compute_costs. - Make currency_id required=True (default still in place — only a programmatic write would null it, but Monetary fields need a non-null anchor). - Add test_current_location_for_confirmed to cover the title-case fallback branch in _compute_current_location. Manifest 19.0.8.3.0 → 19.0.8.3.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:
@@ -86,3 +86,9 @@ class TestFpJobStateMachine(TransactionCase):
|
||||
self.assertEqual(job.actual_cost, 0.0)
|
||||
self.assertEqual(job.margin, 1000.0)
|
||||
self.assertEqual(job.margin_pct, 100.0)
|
||||
|
||||
def test_current_location_for_confirmed(self):
|
||||
job = self._make_job()
|
||||
job.action_confirm()
|
||||
# Forces compute via field read; expect title-cased state
|
||||
self.assertEqual(job.current_location, 'Confirmed')
|
||||
|
||||
Reference in New Issue
Block a user