feat(jobs): add fp.work.centre native model

Replaces mrp.workcenter for plating. Domain-specific kinds
(wet_line/bake/mask/rack/inspect/other) drive release-ready
validation on steps. ACLs follow existing supervisor/manager
hierarchy.

Note: spec listed default_oven_id Many2one to fusion.plating.oven
but that model does not exist in core (the bake-oven model
fusion.plating.bake.oven lives in fusion_plating_shopfloor, which
core cannot depend on). Field omitted; the bridge that adds
fp.job/fp.job.step can re-introduce it via _inherit later.

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:
gsinghpal
2026-04-24 21:12:32 -04:00
parent 41d0908ade
commit 37f917824a
6 changed files with 94 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import test_fp_work_centre

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from odoo.tests.common import TransactionCase
class TestFpWorkCentre(TransactionCase):
def test_create_work_centre_minimal(self):
wc = self.env['fp.work.centre'].create({
'name': 'Bath Line 1',
'code': 'BL1',
'kind': 'wet_line',
})
self.assertEqual(wc.name, 'Bath Line 1')
self.assertEqual(wc.kind, 'wet_line')
self.assertTrue(wc.active)
def test_facility_required_for_active_centre(self):
wc = self.env['fp.work.centre'].create({
'name': 'Test',
'code': 'T',
'kind': 'other',
})
self.assertFalse(wc.facility_id)
def test_kind_selection_values(self):
kinds = dict(
self.env['fp.work.centre']._fields['kind'].selection
)
for k in ('wet_line', 'bake', 'mask', 'rack', 'inspect', 'other'):
self.assertIn(k, kinds)