From 7a02382623d02e4397f3fc295df262e8c55a45de Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Tue, 12 May 2026 19:08:38 -0400 Subject: [PATCH] fix(reports): WO Margin model name must match report_name + '_template' suffix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix swapped t-field -> t-esc so the QWeb error stopped, but the report still printed blank. Root cause: Odoo looks up the report data model via env['report.'], but our model was named 'report.fusion_plating_jobs.report_fp_job_margin' while the action's report_name is 'fusion_plating_jobs.report_fp_job_margin_template'. The model lookup missed, _get_report_values never fired, and the template rendered with no 'rows' in scope — empty foreach -> empty page. Renamed the model to report.fusion_plating_jobs.report_fp_job_margin_template. Verified: PDF size jumped from 1229 bytes (blank) to 125880 bytes (fully populated). HTML now contains 'Job Margin', 'Step Breakdown', and the actual WO name. Co-Authored-By: Claude Opus 4.7 (1M context) --- fusion_plating/fusion_plating_jobs/__manifest__.py | 2 +- .../fusion_plating_jobs/models/report_fp_job_margin.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fusion_plating/fusion_plating_jobs/__manifest__.py b/fusion_plating/fusion_plating_jobs/__manifest__.py index aaed5ae3..14866dcf 100644 --- a/fusion_plating/fusion_plating_jobs/__manifest__.py +++ b/fusion_plating/fusion_plating_jobs/__manifest__.py @@ -3,7 +3,7 @@ # License OPL-1 (Odoo Proprietary License v1.0) { 'name': 'Fusion Plating — Native Jobs', - 'version': '19.0.8.22.9', + 'version': '19.0.8.22.10', 'category': 'Manufacturing/Plating', 'summary': 'Native plating job model — replaces mrp.production / mrp.workorder bridge.', 'author': 'Nexa Systems Inc.', diff --git a/fusion_plating/fusion_plating_jobs/models/report_fp_job_margin.py b/fusion_plating/fusion_plating_jobs/models/report_fp_job_margin.py index 71bc89a9..fa40900b 100644 --- a/fusion_plating/fusion_plating_jobs/models/report_fp_job_margin.py +++ b/fusion_plating/fusion_plating_jobs/models/report_fp_job_margin.py @@ -10,7 +10,15 @@ from odoo import api, models class ReportFpJobMargin(models.AbstractModel): - _name = 'report.fusion_plating_jobs.report_fp_job_margin' + # Odoo looks up the report's data model via report.. + # The action's report_name is `fusion_plating_jobs.report_fp_job_margin_template`, + # so this MUST be `report.fusion_plating_jobs.report_fp_job_margin_template`. + # Pre-2026-05-12 the model name was missing the `_template` suffix, + # which silently caused _get_report_values to never fire and the + # template rendered with no `rows` -> blank PDF. The t-field error + # was masking this because it crashed earlier; once t-field was + # swapped to t-esc the blank-render surfaced. + _name = 'report.fusion_plating_jobs.report_fp_job_margin_template' _description = 'Work Order Margin Report' @api.model