100 lines
2.8 KiB
Python
100 lines
2.8 KiB
Python
# -*- 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 FpCnscLicence(models.Model):
|
|
"""CNSC Licence record.
|
|
|
|
The Canadian Nuclear Safety Commission (CNSC) regulates all nuclear
|
|
activities in Canada. A plating / finishing supplier that works on
|
|
nuclear items may hold — or be listed under — one or more CNSC
|
|
licences:
|
|
|
|
* Class II nuclear facility licence (on-site sources,
|
|
irradiators, handling of nuclear substances)
|
|
* Transport licence for nuclear substances
|
|
* Export licence for controlled nuclear items
|
|
|
|
This record tracks the licence number, issue and expiry dates, and
|
|
any key conditions so the facility can manage renewals and
|
|
compliance awareness.
|
|
"""
|
|
_name = 'fusion.plating.cnsc.licence'
|
|
_description = 'Fusion Plating — CNSC Licence'
|
|
_inherit = ['mail.thread', 'mail.activity.mixin']
|
|
_order = 'expiry_date, name'
|
|
|
|
name = fields.Char(
|
|
string='Title',
|
|
required=True,
|
|
tracking=True,
|
|
)
|
|
licence_number = fields.Char(
|
|
string='Licence Number',
|
|
required=True,
|
|
tracking=True,
|
|
)
|
|
facility_id = fields.Many2one(
|
|
'fusion.plating.facility',
|
|
string='Facility',
|
|
tracking=True,
|
|
)
|
|
company_id = fields.Many2one(
|
|
'res.company',
|
|
related='facility_id.company_id',
|
|
store=True,
|
|
readonly=True,
|
|
)
|
|
licence_type = fields.Selection(
|
|
[
|
|
('class_ii_nuclear_facility', 'Class II Nuclear Facility'),
|
|
('transport', 'Transport of Nuclear Substances'),
|
|
('export', 'Export of Controlled Nuclear Items'),
|
|
('other', 'Other'),
|
|
],
|
|
string='Licence Type',
|
|
default='class_ii_nuclear_facility',
|
|
required=True,
|
|
tracking=True,
|
|
)
|
|
issue_date = fields.Date(
|
|
string='Issue Date',
|
|
tracking=True,
|
|
)
|
|
expiry_date = fields.Date(
|
|
string='Expiry Date',
|
|
tracking=True,
|
|
)
|
|
conditions = fields.Html(
|
|
string='Licence Conditions',
|
|
)
|
|
state = fields.Selection(
|
|
[
|
|
('active', 'Active'),
|
|
('expiring', 'Expiring Soon'),
|
|
('expired', 'Expired'),
|
|
('revoked', 'Revoked'),
|
|
],
|
|
string='Status',
|
|
default='active',
|
|
required=True,
|
|
tracking=True,
|
|
)
|
|
attachment_id = fields.Many2one(
|
|
'ir.attachment',
|
|
string='Licence Document',
|
|
)
|
|
active = fields.Boolean(default=True)
|
|
|
|
_sql_constraints = [
|
|
(
|
|
'fp_cnsc_licence_number_uniq',
|
|
'unique(licence_number, company_id)',
|
|
'CNSC licence number must be unique per company.',
|
|
),
|
|
]
|