# -*- 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 FpCoatingConfig(models.Model): """Coating configuration template. Defines a specific coating setup: process type, phosphorus level, thickness range, spec reference, and required pre/post treatments. Used by the configurator to drive pricing and recipe selection. """ _name = 'fp.coating.config' _description = 'Fusion Plating — Coating Configuration' _order = 'sequence, name' name = fields.Char(string='Configuration', required=True, help='e.g. "EN Mid-Phos AMS 2404"') process_type_id = fields.Many2one( 'fusion.plating.process.type', string='Process Type', required=True, ondelete='restrict', ) recipe_id = fields.Many2one( 'fusion.plating.process.node', string='Default Recipe', domain="[('node_type', '=', 'recipe')]", help='Default recipe template for this coating configuration.', ) phosphorus_level = fields.Selection( [('low_phos', 'Low Phosphorus (2-5%)'), ('mid_phos', 'Mid Phosphorus (6-9%)'), ('high_phos', 'High Phosphorus (10-13%)'), ('na', 'N/A')], string='Phosphorus Level', default='na', help='EN-specific. Set to N/A for non-EN processes.', ) thickness_min = fields.Float(string='Min Thickness', digits=(10, 4)) thickness_max = fields.Float(string='Max Thickness', digits=(10, 4)) thickness_uom = fields.Selection( [('mils', 'mils'), ('microns', 'microns'), ('inches', 'inches')], string='Thickness UoM', default='mils', ) spec_reference = fields.Char(string='Spec Reference', help='e.g. "AMS 2404", "E499-303-00-005"') certification_level = fields.Selection( [('commercial', 'Commercial'), ('mil_spec', 'Mil-Spec'), ('nadcap', 'Nadcap'), ('nuclear', 'Nuclear (CSA N299)')], string='Certification Level', default='commercial', ) pre_treatment_ids = fields.Many2many( 'fp.treatment', 'fp_coating_config_pre_treatment_rel', 'config_id', 'treatment_id', string='Pre-Treatments', domain="[('treatment_type', '=', 'pre')]", ) post_treatment_ids = fields.Many2many( 'fp.treatment', 'fp_coating_config_post_treatment_rel', 'config_id', 'treatment_id', string='Post-Treatments', domain="[('treatment_type', '=', 'post')]", ) sequence = fields.Integer(string='Sequence', default=10) description = fields.Text(string='Description') active = fields.Boolean(string='Active', default=True)