74 lines
2.1 KiB
Python
74 lines
2.1 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 FpConfigItem(models.Model):
|
|
"""Configuration management baseline item.
|
|
|
|
Tracks a configuration item (product, process, document, tooling,
|
|
etc.) under formal configuration management control per AS9100
|
|
§8.1.2. Each item has a baseline revision, the current in-use
|
|
revision, and a change history log for traceability.
|
|
"""
|
|
_name = 'fusion.plating.config.item'
|
|
_description = 'Fusion Plating — Configuration Management Item'
|
|
_inherit = ['mail.thread', 'mail.activity.mixin']
|
|
_order = 'name, id'
|
|
|
|
name = fields.Char(
|
|
string='Name',
|
|
required=True,
|
|
tracking=True,
|
|
)
|
|
code = fields.Char(
|
|
string='Code',
|
|
required=True,
|
|
tracking=True,
|
|
)
|
|
baseline_revision = fields.Char(
|
|
string='Baseline Revision',
|
|
tracking=True,
|
|
help='The frozen baseline revision this item starts from.',
|
|
)
|
|
current_revision = fields.Char(
|
|
string='Current Revision',
|
|
tracking=True,
|
|
help='The revision currently in effect — usually the most '
|
|
'recently approved change.',
|
|
)
|
|
approved_by_id = fields.Many2one(
|
|
'res.users',
|
|
string='Approved By',
|
|
tracking=True,
|
|
)
|
|
approval_date = fields.Date(
|
|
string='Approval Date',
|
|
tracking=True,
|
|
)
|
|
change_history = fields.Html(
|
|
string='Change History',
|
|
help='Manual log of baseline changes. Use dated entries to keep '
|
|
'full traceability for auditors.',
|
|
)
|
|
notes = fields.Html(
|
|
string='Notes',
|
|
)
|
|
company_id = fields.Many2one(
|
|
'res.company',
|
|
string='Company',
|
|
default=lambda self: self.env.company,
|
|
)
|
|
active = fields.Boolean(default=True)
|
|
|
|
_sql_constraints = [
|
|
(
|
|
'fp_config_item_code_uniq',
|
|
'unique(code, company_id)',
|
|
'Configuration item codes must be unique per company.',
|
|
),
|
|
]
|