# -*- 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 FpCertificatePart(models.Model): """One row per part on a combined Certificate of Conformance. A work order can cover several parts that share the same plating process; the combined CoC lists each with its own identity, spec, and quantities. Fields are snapshots taken at cert-creation time. """ _name = 'fp.certificate.part' _description = 'Certificate Part Line' _order = 'certificate_id, sequence, id' _rec_name = 'part_number' certificate_id = fields.Many2one( 'fp.certificate', string='Certificate', required=True, ondelete='cascade', index=True,) sequence = fields.Integer(default=10) sale_order_line_id = fields.Many2one( 'sale.order.line', string='Source SO Line', help='The order line this part row was built from (traceability).',) part_catalog_id = fields.Many2one('fp.part.catalog', string='Part') part_number = fields.Char(string='Part Number') # snapshot part_name = fields.Char(string='Part Name') # snapshot description = fields.Char(string='Description') # customer-facing snapshot serial = fields.Char(string='Serial Number(s)') # comma-joined snapshot customer_spec_id = fields.Many2one( 'fusion.plating.customer.spec', string='Customer Spec',) spec_reference = fields.Char(string='Spec Reference') # snapshot 'CODE Rev X' # Per-part; the parent fp.certificate keeps cert-level legacy totals. quantity_shipped = fields.Integer(string='Qty Shipped') nc_quantity = fields.Integer(string='NC Qty')