Skip to content

[18.0][FIX] base_report_to_printer: avoid double print of reports - #472

Open
jans23 wants to merge 1 commit into
OCA:18.0from
Nitrokey:18.0-fix-base_report_to_printer-double-print
Open

[18.0][FIX] base_report_to_printer: avoid double print of reports#472
jans23 wants to merge 1 commit into
OCA:18.0from
Nitrokey:18.0-fix-base_report_to_printer-double-print

Conversation

@jans23

@jans23 jans23 commented Jul 16, 2026

Copy link
Copy Markdown

When a report is configured to print on a server-side printer and the action has close_on_report_download set (e.g. product label printing), the report was printed twice.

The client-side report action handler handled close_on_report_download itself and returned the result of the act_window_close action, which resolves to undefined. The action manager (_executeReportAction) then treated the report as not handled and fell back to downloading it via /report/download. That download re-rendered the qweb-pdf without the must_skip_send_to_printer context, so _render_qweb_pdf sent it to the printer a second time.

Return a truthy value from the handler instead and let the action manager take care of close_on_report_download and the onClose callback, which it already does for any truthy handler result.

When a report is configured to print on a server-side printer and the
action has close_on_report_download set (e.g. product label printing),
the report was printed twice.

The client-side report action handler handled close_on_report_download
itself and returned the result of the act_window_close action, which
resolves to undefined. The action manager (_executeReportAction) then
treated the report as not handled and fell back to downloading it via
/report/download. That download re-rendered the qweb-pdf without the
must_skip_send_to_printer context, so _render_qweb_pdf sent it to the
printer a second time.

Return a truthy value from the handler instead and let the action
manager take care of close_on_report_download and the onClose callback,
which it already does for any truthy handler result.
@OCA-git-bot OCA-git-bot added series:18.0 mod:base_report_to_printer Module base_report_to_printer labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:base_report_to_printer Module base_report_to_printer series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants