Two distinct entities were both labelled 'Work Centre' (US/UK spelling
the only differentiator — confusing). Renamed by purpose, model IDs
unchanged so all 12+9 existing cross-refs keep working:
fusion.plating.work.center → 'Production Line'
Physical shop-layout grouping that owns tanks. Examples: 'Line 1 —
EN', 'Anodize Line', 'Prep Bay'. Has tank_ids (O2M),
supported_process_ids (M2M), capacity_per_day. The thing tanks live
in.
fp.work.centre → 'Routing Station'
Per-job-step routing entity (post-Sub-11 mrp.workcenter replacement).
Has 'kind' selection (wet_line / bake / mask / rack / inspect),
cost_per_hour for fp.job.step rollup, default_bath_id +
default_tank_id for release-ready validation. The thing a job step
routes through.
Conceptually a Production Line CONTAINS many Routing Stations (e.g.
'EN Line' production line has wet-line, bake, inspect routing
stations on it).
Updated:
- _description on both models
- string= on the name fields
- list/form/search view strings
- act_window names ('Production Lines' / 'Routing Stations')
- menu items in fp_menu.xml + fp_jobs_menu.xml
- doc comments in both model files explaining the distinction
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
71 lines
2.6 KiB
Python
71 lines
2.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Copyright 2026 Nexa Systems Inc.
|
|
# License OPL-1 (Odoo Proprietary License v1.0)
|
|
#
|
|
# fp.work.centre — native plating work-centre model.
|
|
#
|
|
# Replaces mrp.workcenter for the plating flow. Plating work centres
|
|
# are domain-specific (a tank line, a bake oven, a rack station — not
|
|
# assembly cells). Each centre has a 'kind' that drives release-ready
|
|
# validation on fp.job.step (e.g. wet_line -> bath+tank required).
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class FpWorkCentre(models.Model):
|
|
"""Routing station for a job step — replaces mrp.workcenter for
|
|
plating after the Sub 11 MRP cutout.
|
|
|
|
Each routing station has a `kind` (wet_line / bake / mask / rack /
|
|
inspect / other) that drives release-ready validation on
|
|
`fp.job.step` (e.g. wet_line requires bath+tank to be set before
|
|
the step can start). Costable via `cost_per_hour`.
|
|
|
|
Distinct from `fusion.plating.work.center` (Production Line),
|
|
which is the physical shop-layout grouping that owns tanks.
|
|
A Production Line typically contains many Routing Stations.
|
|
"""
|
|
_name = 'fp.work.centre'
|
|
_description = 'Plating Routing Station'
|
|
_order = 'sequence, code, name'
|
|
|
|
name = fields.Char(string='Routing Station', required=True)
|
|
code = fields.Char(required=True, help='Short code used on stickers and reports.')
|
|
sequence = fields.Integer(default=10)
|
|
facility_id = fields.Many2one(
|
|
'fusion.plating.facility',
|
|
string='Facility',
|
|
)
|
|
kind = fields.Selection(
|
|
[
|
|
('wet_line', 'Wet Line'),
|
|
('bake', 'Bake Oven'),
|
|
('mask', 'Masking'),
|
|
('rack', 'Racking'),
|
|
('inspect', 'Inspection'),
|
|
('other', 'Other'),
|
|
],
|
|
required=True,
|
|
default='other',
|
|
)
|
|
cost_per_hour = fields.Monetary(
|
|
currency_field='currency_id',
|
|
help='Used for fp.job.step cost rollups.',
|
|
)
|
|
currency_id = fields.Many2one(
|
|
'res.currency',
|
|
default=lambda self: self.env.company.currency_id,
|
|
)
|
|
default_bath_id = fields.Many2one('fusion.plating.bath')
|
|
default_tank_id = fields.Many2one('fusion.plating.tank')
|
|
# NOTE: `default_oven_id` from the spec/plan is omitted here — the
|
|
# `fusion.plating.bake.oven` model lives in fusion_plating_shopfloor,
|
|
# which the core module cannot depend on. The bridge module that
|
|
# introduces fp.job/fp.job.step (Task 1.x) can re-introduce this
|
|
# field via _inherit if/when the bake-oven coupling is needed.
|
|
active = fields.Boolean(default=True)
|
|
|
|
_sql_constraints = [
|
|
('unique_code', 'UNIQUE(code)', 'Work centre code must be unique.'),
|
|
]
|