Repository navigation
[17.0][ADD] web_report_pdf_preview: Preview PDF reports in a dialog - #1248
Open
edescalona wants to merge 1 commit into
Open
edescalona wants to merge 1 commit into
edescalona wants to merge 1 commit into
Conversation
Add a "Preview PDF" option to PDF reports. When it is set, printing the report fetches the PDF once and shows it in a dialog with the Odoo PDF viewer instead of downloading it. The dialog has an "Open in new tab" button that opens the same PDF in the browser viewer without generating it again. Reports without the option, non-PDF reports, and the cases where wkhtmltopdf is not usable or the server does not return a PDF keep the standard download.
edescalona
marked this pull request as ready for review
November 29, 2026 21:10
Author
|
Hi @rrebollo @jelenapoblet @pedrobaeza could you please review? Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@BinhexTeam
T26853
This module adds a Preview PDF option to PDF reports, unchecked by default. When it is checked, printing the report opens the PDF in a dialog with the Odoo PDF viewer instead of downloading it.
How it works
pdf_previewtravels with the report action, fromreport_action()and_get_readable_fields(), so the client makes no extra call to know it.ir.actions.report handlersregistry checks wkhtmltopdf as the standard download does, fetches the PDF once from/report/pdf/...with the user context merged with the action context, and shows it in aDialogwith pdf.js.blob:URL) in the browser viewer without generating it again. Closing the dialog releases it.close_on_report_download, the wizard is closed, as after a download.Known issues