feat(promote-customer-spec): Phase A — recipe + spec foundation
- Add fp.recipe.thickness model (replaces fp.coating.thickness, scoped to recipe root)
- Add spec metadata + bake-relief fields to fusion.plating.process.node (recipe root):
phosphorus_level, thickness_min/max/uom, thickness_option_ids,
requires_bake_relief + bake_window_hours/temperature/duration
- Add recipe_ids M2M + print_on_cert to fusion.plating.customer.spec
- Add applicable_spec_ids reverse M2M as inherit in fusion_plating_quality
(avoids circular dep — core can't reference customer.spec which lives in quality)
- Surface new fields on recipe form ("Specification & Bake" notebook page)
- Surface recipe linkage on customer spec form
Pure additive. Foundation for Phases B-E.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ from . import fp_calibration
|
||||
from . import fp_calibration_event
|
||||
from . import fp_avl
|
||||
from . import fp_customer_spec
|
||||
from . import fp_process_node_inherit
|
||||
from . import fp_audit
|
||||
from . import fp_fair
|
||||
from . import fp_doc_control
|
||||
|
||||
@@ -74,6 +74,22 @@ class FpCustomerSpec(models.Model):
|
||||
notes = fields.Html(
|
||||
string='Notes',
|
||||
)
|
||||
recipe_ids = fields.Many2many(
|
||||
'fusion.plating.process.node',
|
||||
'fp_customer_spec_recipe_rel',
|
||||
'spec_id', 'recipe_id',
|
||||
domain="[('node_type', '=', 'recipe'), ('parent_id', '=', False)]",
|
||||
string='Applicable Recipes',
|
||||
help='Recipes that can produce work to this specification. '
|
||||
'Many-to-many — one spec can cover multiple processes; '
|
||||
'one recipe can satisfy multiple specs.',
|
||||
)
|
||||
print_on_cert = fields.Boolean(
|
||||
string='Print on Certificate',
|
||||
default=True,
|
||||
help="When enabled, this spec's code+revision appear on the CoC "
|
||||
'when the spec is selected on the SO line.',
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
'res.company',
|
||||
string='Company',
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
# Part of the Fusion Plating product family.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class FusionPlatingProcessNode(models.Model):
|
||||
"""Add the reverse M2M from recipe → applicable specifications.
|
||||
|
||||
The forward M2M lives on fusion.plating.customer.spec.recipe_ids.
|
||||
Defined here (in the quality module) because customer.spec is owned
|
||||
by quality and core can't reference it without a circular dep.
|
||||
"""
|
||||
_inherit = 'fusion.plating.process.node'
|
||||
|
||||
applicable_spec_ids = fields.Many2many(
|
||||
'fusion.plating.customer.spec',
|
||||
'fp_customer_spec_recipe_rel',
|
||||
'recipe_id', 'spec_id',
|
||||
string='Applicable Specifications',
|
||||
help='Customer / industry specifications this recipe is qualified '
|
||||
'to satisfy. Set on the spec record; mirrored here for '
|
||||
'navigation.',
|
||||
)
|
||||
Reference in New Issue
Block a user