From 4585533da29e73007c8069e0ccc64e857dd2678d Mon Sep 17 00:00:00 2001 From: Bastian Guenther Date: Tue, 17 Jan 2023 17:24:56 +0100 Subject: [PATCH] [IMP] base_report_to_printer: Now blocking ui while printing is in progress to ensure, user cannot abort printing by triggering another action --- base_report_to_printer/__manifest__.py | 2 +- base_report_to_printer/static/src/js/qweb_action_manager.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/base_report_to_printer/__manifest__.py b/base_report_to_printer/__manifest__.py index 1a3abaff6bf..dc96ad25fc7 100644 --- a/base_report_to_printer/__manifest__.py +++ b/base_report_to_printer/__manifest__.py @@ -7,7 +7,7 @@ { "name": "Report to printer", - "version": "13.0.1.6.0", + "version": "13.0.1.7.0", "category": "Generic Modules/Base", "author": "Agile Business Group & Domsense, Pegueroles SCP, NaN," " LasLabs, Camptocamp, Odoo Community Association (OCA)," diff --git a/base_report_to_printer/static/src/js/qweb_action_manager.js b/base_report_to_printer/static/src/js/qweb_action_manager.js index 36452e0ec89..67a495bea4e 100644 --- a/base_report_to_printer/static/src/js/qweb_action_manager.js +++ b/base_report_to_printer/static/src/js/qweb_action_manager.js @@ -4,12 +4,14 @@ odoo.define("base_report_to_printer.print", function(require) { var ActionManager = require("web.ActionManager"); var core = require("web.core"); var _t = core._t; + var framework = require("web.framework"); ActionManager.include({ _triggerDownload: function(action, options, type) { var self = this; var _super = this._super; if (type === "pdf" || type === "text") { + framework.blockUI(); this._rpc({ model: "ir.actions.report", method: "print_action_for_report_name", @@ -32,6 +34,7 @@ odoo.define("base_report_to_printer.print", function(require) { print_action.printer_name ) ); + framework.unblockUI(); return self._executeReloadActionAfterPrint( action, options @@ -48,6 +51,7 @@ odoo.define("base_report_to_printer.print", function(require) { print_action.printer_name ) ); + framework.unblockUI(); return self._executeReloadActionAfterPrint( action, options @@ -55,6 +59,7 @@ odoo.define("base_report_to_printer.print", function(require) { } ); } else { + framework.unblockUI(); return _super.apply(self, [action, options, type]); } });