From 34b3c72631c898c4d1b670c618d1f45d14f04b57 Mon Sep 17 00:00:00 2001 From: Daniel Palumbo Date: Mon, 3 Aug 2026 11:32:36 +0200 Subject: [PATCH 1/2] [T1523] ADD: Preview PDF button on communication job The existing Preview button only rendered raw HTML, never the actual PDF report, so a broken image (a positioning/CSS bug, or a static asset that fails to load) could go unnoticed until physical printing. Add a Preview PDF button that renders through the real ir.actions.report action instead. --- partner_communication/models/communication_job.py | 6 ++++++ partner_communication/views/communication_job_view.xml | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/partner_communication/models/communication_job.py b/partner_communication/models/communication_job.py index ab5da275e..1cc613822 100644 --- a/partner_communication/models/communication_job.py +++ b/partner_communication/models/communication_job.py @@ -816,6 +816,12 @@ def preview_pdf(self): "target": "new", } + def preview_pdf_report(self): + self.ensure_one() + return self.report_id.with_context(lang=self.partner_id.lang).report_action( + self.ids, config=False + ) + def download_data(self): action = { "type": "ir.actions.act_window", diff --git a/partner_communication/views/communication_job_view.xml b/partner_communication/views/communication_job_view.xml index 29f4fbe7e..debddd77f 100644 --- a/partner_communication/views/communication_job_view.xml +++ b/partner_communication/views/communication_job_view.xml @@ -82,6 +82,14 @@ icon="fa-search-plus" class="oe_stat_button" invisible="state != 'pending'" + /> +