[18.0][FIX] base_report_to_printer: avoid double print of reports - #472
Open
jans23 wants to merge 1 commit into
Open
[18.0][FIX] base_report_to_printer: avoid double print of reports#472jans23 wants to merge 1 commit into
jans23 wants to merge 1 commit into
Conversation
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.
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.
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.