# -*- 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 FpCgpControlledGood(models.Model): """Inventory of controlled goods currently handled by the shop. This is intentionally a lightweight, hand-maintained register of what the shop actually processes — parts, assemblies, or materials that fall under the Schedule to the Defence Production Act. It is not a replacement for the Odoo stock module; it is the CGP-specific audit trail that an AI can show a PSPC inspector. """ _name = 'fusion.plating.cgp.controlled.good' _description = 'Fusion Plating — Controlled Good' _inherit = ['mail.thread', 'mail.activity.mixin'] _order = 'name' name = fields.Char( string='Name', required=True, tracking=True, ) description = fields.Html(string='Description') schedule_category = fields.Char( string='Schedule Category', tracking=True, help='Category under the Schedule to the Defence Production Act, ' 'e.g. "Group 2: Munitions" or a specific ECL entry.', ) customer_id = fields.Many2one( 'res.partner', string='Customer', tracking=True, ) current_quantity = fields.Float( string='Current Quantity', tracking=True, ) location = fields.Char( string='Storage Location', tracking=True, ) state = fields.Selection( [ ('received', 'Received'), ('in_process', 'In Process'), ('in_storage', 'In Storage'), ('shipped', 'Shipped'), ('destroyed', 'Destroyed'), ], string='Status', default='received', required=True, tracking=True, ) company_id = fields.Many2one( 'res.company', string='Company', default=lambda self: self.env.company, ) active = fields.Boolean(default=True) def action_mark_in_process(self): self.write({'state': 'in_process'}) def action_mark_in_storage(self): self.write({'state': 'in_storage'}) def action_mark_shipped(self): self.write({'state': 'shipped'}) def action_mark_destroyed(self): self.write({'state': 'destroyed'})