Skip to content

Commit

Permalink
Merge pull request #4 from AmetrasIntelligence/ADOO-836
Browse files Browse the repository at this point in the history
[IMP] base_report_to_printer: Now blocking ui while printing is in progress to ensure, user cannot abort printing by triggering another action
  • Loading branch information
baguenth authored Jan 20, 2023
2 parents a56b3e8 + 4585533 commit a00c6aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base_report_to_printer/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),"
Expand Down
5 changes: 5 additions & 0 deletions base_report_to_printer/static/src/js/qweb_action_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -32,6 +34,7 @@ odoo.define("base_report_to_printer.print", function(require) {
print_action.printer_name
)
);
framework.unblockUI();
return self._executeReloadActionAfterPrint(
action,
options
Expand All @@ -48,13 +51,15 @@ odoo.define("base_report_to_printer.print", function(require) {
print_action.printer_name
)
);
framework.unblockUI();
return self._executeReloadActionAfterPrint(
action,
options
);
}
);
} else {
framework.unblockUI();
return _super.apply(self, [action, options, type]);
}
});
Expand Down

0 comments on commit a00c6aa

Please sign in to comment.