36 lines
1.7 KiB
Python
36 lines
1.7 KiB
Python
# -*- 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 FpDischargeLimit(models.Model):
|
|
_name = 'fusion.plating.discharge.limit'
|
|
_description = 'Fusion Plating - Discharge Limit'
|
|
_order = 'jurisdiction_id, parameter, discharge_point'
|
|
|
|
name = fields.Char(string='Name', required=True)
|
|
parameter = fields.Char(string='Parameter', required=True)
|
|
jurisdiction_id = fields.Many2one('fusion.plating.jurisdiction', string='Jurisdiction', ondelete='restrict')
|
|
regulation_ref = fields.Char(string='Regulation Reference')
|
|
discharge_point = fields.Selection(
|
|
[('sanitary', 'Sanitary Sewer'), ('storm', 'Storm Sewer'),
|
|
('combined', 'Combined Sewer'), ('air', 'Air Emission'), ('other', 'Other')],
|
|
string='Discharge Point', default='sanitary', required=True,
|
|
)
|
|
limit_value = fields.Float(string='Limit', digits=(16, 4),
|
|
help='Numerical limit, expressed in the unit selected below.')
|
|
uom = fields.Selection(FP_UOM_SELECTION, string='UoM',
|
|
help='Unit the limit is enforced in (typical: mg/L for liquid '
|
|
'discharge, mg/m³ for air emissions).')
|
|
limit_type = fields.Selection(
|
|
[('max', 'Maximum'), ('min', 'Minimum'), ('range', 'Range'), ('ceiling', 'Hard Ceiling')],
|
|
string='Limit Type', default='max', required=True,
|
|
)
|
|
min_value = fields.Float(string='Min Value', digits=(16, 4))
|
|
reference_url = fields.Char(string='Source URL')
|
|
notes = fields.Text(string='Notes')
|
|
active = fields.Boolean(default=True)
|