From 6a5364e05392af1aa4b5f61bc7e93a00546f15a6 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Thu, 28 May 2026 22:28:04 -0400 Subject: [PATCH] fix(plating): compact CoC first column + 3-line part data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Column titles now render inline "English / French" on one line (was stacked), cutting header height. First column drops "Line Item": it is now Part Number / No. de pièce, Description / Description, Serial Number / Numéro de série with a tight line-height. - First-column DATA shows three lines — part number, part name, serial number — via new fp.certificate._fp_resolve_part_identity() (part name from the job's part catalog, serials from the matching SO line; blanks fall back to "-"). Bump certificates 19.0.9.2.0, reports 19.0.11.31.0. Deployed + verified on entech (CoC-30059: ('9876699373', 'VALVE BODY - COMPLETE - ASSY', ''), 243KB render). Co-Authored-By: Claude Opus 4.7 --- .../__manifest__.py | 2 +- .../models/fp_certificate.py | 43 +++++++++++++++++++ .../fusion_plating_reports/__manifest__.py | 2 +- .../report/report_coc.xml | 42 ++++++++---------- 4 files changed, 63 insertions(+), 26 deletions(-) diff --git a/fusion_plating/fusion_plating_certificates/__manifest__.py b/fusion_plating/fusion_plating_certificates/__manifest__.py index d9f2ca1a..19257427 100644 --- a/fusion_plating/fusion_plating_certificates/__manifest__.py +++ b/fusion_plating/fusion_plating_certificates/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Fusion Plating — Certificates', - 'version': '19.0.9.1.0', + 'version': '19.0.9.2.0', 'category': 'Manufacturing/Plating', 'summary': 'Certificate registry for CoC, thickness reports, and quality documents.', 'description': """ diff --git a/fusion_plating/fusion_plating_certificates/models/fp_certificate.py b/fusion_plating/fusion_plating_certificates/models/fp_certificate.py index 2fa39b86..9d7e2447 100644 --- a/fusion_plating/fusion_plating_certificates/models/fp_certificate.py +++ b/fusion_plating/fusion_plating_certificates/models/fp_certificate.py @@ -777,6 +777,49 @@ class FpCertificate(models.Model): desc = line.name return (desc or '').strip() + def _fp_resolve_part_identity(self): + """Return (part_number, part_name, serials) for the CoC line-item + cell's three lines (client request 2026-05-28). + + - part_number: the cert's own field, falling back to the job's + part_catalog part_number. + - part_name: the job's part_catalog.name. + - serials: the matching SO line's x_fc_serial_ids names, + comma-joined. + + All cross-module access is guarded so the method stays safe even + if the jobs / configurator layers aren't installed (returns '' + for the unresolved pieces). + """ + self.ensure_one() + job = self.x_fc_job_id if 'x_fc_job_id' in self._fields else False + part = (job.part_catalog_id + if job and 'part_catalog_id' in job._fields else False) + part_number = ( + self.part_number + or (part.part_number + if part and 'part_number' in part._fields else '') + or '' + ) + part_name = (part.name if part and 'name' in part._fields else '') or '' + serials = '' + so = self.sale_order_id or ( + job.sale_order_id + if job and 'sale_order_id' in job._fields else False + ) + if so: + lines = so.order_line.filtered(lambda l: not l.display_type) + line = self.env['sale.order.line'] + if part and lines and 'x_fc_part_catalog_id' in lines._fields: + line = lines.filtered( + lambda l: l.x_fc_part_catalog_id == part + )[:1] + if not line: + line = lines[:1] + if line and 'x_fc_serial_ids' in line._fields and line.x_fc_serial_ids: + serials = ', '.join(line.x_fc_serial_ids.mapped('name')) + return (part_number, part_name, serials) + def _fp_render_and_attach_pdf(self): """Render the CoC PDF via the bound report action, OPTIONALLY merge the Fischerscope thickness report PDF (uploaded by the diff --git a/fusion_plating/fusion_plating_reports/__manifest__.py b/fusion_plating/fusion_plating_reports/__manifest__.py index 5c27ac36..f631362a 100644 --- a/fusion_plating/fusion_plating_reports/__manifest__.py +++ b/fusion_plating/fusion_plating_reports/__manifest__.py @@ -3,7 +3,7 @@ # License OPL-1 (Odoo Proprietary License v1.0) { 'name': 'Fusion Plating — Reports', - 'version': '19.0.11.30.0', + 'version': '19.0.11.31.0', 'category': 'Manufacturing/Plating', 'summary': 'PDF reports for Fusion Plating: quote, SO, WO, packing, BoL, CoC, invoice, receipt, quality + compliance.', 'depends': [ diff --git a/fusion_plating/fusion_plating_reports/report/report_coc.xml b/fusion_plating/fusion_plating_reports/report/report_coc.xml index 777c1645..cb991024 100644 --- a/fusion_plating/fusion_plating_reports/report/report_coc.xml +++ b/fusion_plating/fusion_plating_reports/report/report_coc.xml @@ -239,16 +239,13 @@ - Date of Certification - Date du certificat + Date of Certification/Date du certificat - Generated By - Créé par + Generated By/Créé par - Work Order # - Bon de travail + Work Order #/Bon de travail @@ -276,39 +273,36 @@ page-break-inside: avoid;"> - - Part Number / Line Item - No. de pièce / Ligne - Description - Description - Serial Number - Numéro de série + +
Part Number/No. de pièce
+
Description/Description
+
Serial Number/Numéro de série
- Process - Procédé + Process/Procédé - Customer PO - Bon de commande + Customer PO/Bon de commande - Shipped - Expédié + Shipped/Expédié - NC Qty - Qté NC + NC Qty/Qté NC - Customer Job No. - Bon de travail client + Customer Job No./Bon de travail client - + + +
+
+
+