# -*- coding: utf-8 -*- # Copyright 2026 Nexa Systems Inc. # License OPL-1 (Odoo Proprietary License v1.0) from odoo import fields, models from odoo.addons.fusion_plating.models._fp_uom_selection import FP_UOM_SELECTION class FpWasteStream(models.Model): _name = 'fusion.plating.waste.stream' _description = 'Fusion Plating - Waste Stream' _order = 'facility_id, name' name = fields.Char(string='Stream', required=True) code = fields.Char(string='Code') facility_id = fields.Many2one('fusion.plating.facility', string='Facility', required=True, ondelete='cascade') company_id = fields.Many2one('res.company', related='facility_id.company_id', store=True, readonly=True) waste_class = fields.Char(string='Waste Class') description = fields.Text(string='Description') physical_state = fields.Selection( [('liquid', 'Liquid'), ('solid', 'Solid'), ('sludge', 'Sludge'), ('gas', 'Gas')], string='Physical State', default='liquid', ) generation_rate = fields.Float(string='Generation Rate', help='Average rate this stream is produced at, expressed in the ' 'rate unit below (typical: kg/day, L/day).') generation_uom = fields.Selection(FP_UOM_SELECTION, string='Rate UoM', default='kg_day', help='Unit of the generation rate (kg/day, L/day, kg/month, etc.).') disposal_method = fields.Char(string='Disposal Method') approved_carrier_id = fields.Many2one('res.partner', string='Approved Carrier', domain=[('is_company', '=', True)]) approved_facility_id = fields.Many2one('res.partner', string='Approved Receiving Facility', domain=[('is_company', '=', True)]) manifest_ids = fields.One2many('fusion.plating.waste.manifest', 'waste_stream_id', string='Manifests') active = fields.Boolean(default=True)