# -*- 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 FpBathParameter(models.Model): """Definition of a bath chemistry parameter. Parameters are process-agnostic at the schema level (e.g. "Temperature", "pH", "Nickel concentration"). Each process type references a set of parameters via fusion.plating.process.type.parameter_ids. Actual target ranges per bath are stored on fusion.plating.bath (per-bath overrides) or on the bath recipe. """ _name = 'fusion.plating.bath.parameter' _description = 'Fusion Plating — Bath Parameter' _order = 'sequence, name' name = fields.Char( string='Parameter', required=True, translate=True, help='Display name (e.g. "Nickel Concentration", "pH").', ) code = fields.Char( string='Code', required=True, help='Short code used in logs and exports (e.g. "Ni", "PH", "TEMP").', ) sequence = fields.Integer( string='Sequence', default=10, ) parameter_type = fields.Selection( [ ('concentration', 'Concentration'), ('temperature', 'Temperature'), ('ph', 'pH'), ('conductivity', 'Conductivity'), ('turbidity', 'Turbidity'), ('ratio', 'Ratio'), ('count', 'Count / Age'), ('other', 'Other'), ], string='Type', required=True, default='concentration', ) uom = fields.Char( string='Unit', help='Display unit (e.g. "g/L", "°C", "pH", "MTO").', ) target_min = fields.Float( string='Default Target Min', help='Default target minimum. Per-bath overrides are allowed.', ) target_max = fields.Float( string='Default Target Max', help='Default target maximum. Per-bath overrides are allowed.', ) warning_tolerance = fields.Float( string='Warning Tolerance %', default=10.0, help='Distance from target limit at which a reading is flagged as warning.', ) decimals = fields.Integer( string='Decimals', default=2, ) description = fields.Text( string='Description', translate=True, ) active = fields.Boolean( string='Active', default=True, ) _sql_constraints = [ ( 'fp_bath_parameter_code_uniq', 'unique(code)', 'Bath parameter code must be unique.', ), ]