feat(fusion_plating_certificates): add fp.certificate.part child model + ACL

Adds the fp.certificate.part model (one row per part on a combined CoC),
the part_line_ids O2M on fp.certificate, and ACL rows for all three
plating roles. No views yet — Task 2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-06-03 22:23:42 -04:00
parent e35c120af8
commit 7cbf4f25df
4 changed files with 46 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
from . import fp_thickness_reading
from . import fp_certificate
from . import fp_certificate_part
from . import res_config_settings
from . import res_partner
from . import fp_delivery

View File

@@ -87,6 +87,10 @@ class FpCertificate(models.Model):
thickness_reading_ids = fields.One2many(
'fp.thickness.reading', 'certificate_id', string='Thickness Readings',
)
part_line_ids = fields.One2many(
'fp.certificate.part', 'certificate_id', string='Parts',
help='One row per part covered by this certificate. Populated at '
'cert creation from the work order\'s sale-order lines.')
# ----- Inline Fischerscope PDF upload (cert-local) ----------------------
# The merge pipeline normally pulls the Fischerscope/XDAL PDF from the

View File

@@ -0,0 +1,38 @@
# -*- 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')