fix(reports): WO Margin model name must match report_name + '_template' suffix
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.<report_name>'], 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) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||||
{
|
{
|
||||||
'name': 'Fusion Plating — Native Jobs',
|
'name': 'Fusion Plating — Native Jobs',
|
||||||
'version': '19.0.8.22.9',
|
'version': '19.0.8.22.10',
|
||||||
'category': 'Manufacturing/Plating',
|
'category': 'Manufacturing/Plating',
|
||||||
'summary': 'Native plating job model — replaces mrp.production / mrp.workorder bridge.',
|
'summary': 'Native plating job model — replaces mrp.production / mrp.workorder bridge.',
|
||||||
'author': 'Nexa Systems Inc.',
|
'author': 'Nexa Systems Inc.',
|
||||||
|
|||||||
@@ -10,7 +10,15 @@ from odoo import api, models
|
|||||||
|
|
||||||
|
|
||||||
class ReportFpJobMargin(models.AbstractModel):
|
class ReportFpJobMargin(models.AbstractModel):
|
||||||
_name = 'report.fusion_plating_jobs.report_fp_job_margin'
|
# Odoo looks up the report's data model via report.<report_name>.
|
||||||
|
# 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'
|
_description = 'Work Order Margin Report'
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|||||||
Reference in New Issue
Block a user