Update base_report_to_printer/__manifest__.py

[13.0] [MIG] set correct website in manifest

Co-Authored-By: Raf Ven <raf.ven@dynapps.be>
This commit is contained in:
Rod Schouteden
2019-10-18 10:17:49 +02:00
committed by David Montull
parent 06b229c342
commit eb68f60237
35 changed files with 1408 additions and 1444 deletions

View File

@@ -1,43 +1,50 @@
odoo.define('base_report_to_printer.print', function (require) {
'use strict';
odoo.define("base_report_to_printer.print", function(require) {
"use strict";
var ActionManager = require('web.ActionManager');
var core = require('web.core');
var ActionManager = require("web.ActionManager");
var core = require("web.core");
var _t = core._t;
ActionManager.include({
_triggerDownload: function (action, options, type) {
_triggerDownload: function(action, options, type) {
var self = this;
var _super = this._super;
if (type === 'pdf') {
if (type === "pdf") {
this._rpc({
model: 'ir.actions.report',
method: 'print_action_for_report_name',
model: "ir.actions.report",
method: "print_action_for_report_name",
args: [action.report_name],
}).then(function (print_action) {
if (print_action && print_action.action === 'server') {
}).then(function(print_action) {
if (print_action && print_action.action === "server") {
self._rpc({
model: 'ir.actions.report',
method: 'print_document',
model: "ir.actions.report",
method: "print_document",
args: [action.id, action.context.active_ids],
kwargs: {data: action.data || {}},
context: action.context || {},
}).then(function () {
self.do_notify(_t('Report'),
_.str.sprintf(
_t('Document sent to the printer %s'),
print_action.printer_name
)
);
}, function () {
self.do_notify(_t('Report'),
_.str.sprintf(
_t('Error when sending the document ' +
'to the printer '),
print_action.printer_name
)
);
});
}).then(
function() {
self.do_notify(
_t("Report"),
_.str.sprintf(
_t("Document sent to the printer %s"),
print_action.printer_name
)
);
},
function() {
self.do_notify(
_t("Report"),
_.str.sprintf(
_t(
"Error when sending the document " +
"to the printer "
),
print_action.printer_name
)
);
}
);
} else {
return _super.apply(self, [action, options, type]);
}