# -*- 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 FpTreatment(models.Model): """Pre- or post-treatment step (bead blast, zincate, bake, passivate, etc.). Used by coating configurations to specify which preparation and finishing steps are required for a given process. """ _name = 'fp.treatment' _description = 'Fusion Plating — Treatment' _order = 'treatment_type, sequence, name' name = fields.Char( string='Treatment', required=True, help='e.g. "Bead Blast", "Zincate", "Hydrogen Embrittlement Bake"', ) treatment_type = fields.Selection( [('pre', 'Pre-Treatment'), ('post', 'Post-Treatment')], string='Type', required=True, default='pre', ) sequence = fields.Integer(string='Sequence', default=10) default_duration_minutes = fields.Float( string='Default Duration (min)', help='Estimated duration per application in minutes.', ) currency_id = fields.Many2one( 'res.currency', string='Currency', default=lambda self: self.env.company.currency_id, ) default_cost = fields.Monetary( string='Default Cost', currency_field='currency_id', help='Default cost per application. Can be overridden on pricing rules.', ) description = fields.Text(string='Description') active = fields.Boolean(string='Active', default=True) _sql_constraints = [ ('fp_treatment_name_type_uniq', 'unique(name, treatment_type)', 'Treatment name must be unique per type.'), ]