diff --git a/.travis.yml b/.travis.yml index e341c3b52..7b49e5c80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ addons: postgresql: "9.6" apt: packages: - - expect-dev # provides unbuffer utility + - expect-dev # provides unbuffer utility - libreoffice stages: diff --git a/report_csv/static/src/js/report/qwebactionmanager.js b/report_csv/static/src/js/report/qwebactionmanager.js index 889ac4471..81fd285d3 100644 --- a/report_csv/static/src/js/report/qwebactionmanager.js +++ b/report_csv/static/src/js/report/qwebactionmanager.js @@ -1,6 +1,6 @@ // © 2019 Creu Blanca // License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). -odoo.define("report_csv.report", function(require) { +odoo.define("report_csv.report", function (require) { "use strict"; var core = require("web.core"); @@ -10,7 +10,7 @@ odoo.define("report_csv.report", function(require) { var _t = core._t; ActionManager.include({ - _downloadReportCSV: function(url, actions) { + _downloadReportCSV: function (url, actions) { var self = this; framework.blockUI(); var type = "csv"; @@ -19,7 +19,7 @@ odoo.define("report_csv.report", function(require) { if ( _.isUndefined(cloned_action.data) || _.isNull(cloned_action.data) || - (_.isObject(cloned_action.data) && _.isEmpty(cloned_action.data)) + _.isObject(cloned_action.data) && _.isEmpty(cloned_action.data) ) { if (cloned_action.context.active_ids) { url += "/" + cloned_action.context.active_ids.join(","); @@ -33,14 +33,14 @@ odoo.define("report_csv.report", function(require) { encodeURIComponent(JSON.stringify(cloned_action.context)); } - return new Promise(function(resolve, reject) { + return new Promise(function (resolve, reject) { var blocked = !session.get_file({ url: url, data: { data: JSON.stringify([url, type]), }, success: resolve, - error: error => { + error: (error) => { self.call("crash_manager", "rpc_error", error); reject(); }, @@ -53,40 +53,40 @@ odoo.define("report_csv.report", function(require) { var message = _t( "A popup window with your report was blocked. You " + "may need to change your browser settings to allow " + - "popup windows for this page." + "popup windows for this page.", ); this.do_warn(_t("Warning"), message, true); } }); }, - _triggerDownload: function(action, options, type) { + _triggerDownload: function (action, options, type) { var self = this; var reportUrls = this._makeReportUrls(action); if (type === "csv") { return this._downloadReportCSV(reportUrls[type], action).then( - function() { + function () { if (action.close_on_report_download) { var closeAction = {type: "ir.actions.act_window_close"}; return self.doAction( closeAction, - _.pick(options, "on_close") + _.pick(options, "on_close"), ); } return options.on_close(); - } + }, ); } return this._super.apply(this, arguments); }, - _makeReportUrls: function(action) { + _makeReportUrls: function (action) { var reportUrls = this._super.apply(this, arguments); reportUrls.csv = "/report/csv/" + action.report_name; return reportUrls; }, - _executeReportAction: function(action, options) { + _executeReportAction: function (action, options) { var self = this; if (action.report_type === "csv") { return self._triggerDownload(action, options, "csv"); diff --git a/report_py3o/demo/report_py3o.xml b/report_py3o/demo/report_py3o.xml index 240960ead..bc3d06ec6 100644 --- a/report_py3o/demo/report_py3o.xml +++ b/report_py3o/demo/report_py3o.xml @@ -1,20 +1,17 @@ - + - - - Py3o Demo Report - ir.actions.report - res.users - py3o_user_info - py3o - odt - report_py3o - demo/res_user.odt - - report + Py3o Demo Report + ir.actions.report + res.users + py3o_user_info + py3o + odt + report_py3o + demo/res_user.odt + + report - - + diff --git a/report_py3o/static/src/js/py3oactionmanager.js b/report_py3o/static/src/js/py3oactionmanager.js index 70ff21086..5c92fb26a 100644 --- a/report_py3o/static/src/js/py3oactionmanager.js +++ b/report_py3o/static/src/js/py3oactionmanager.js @@ -1,39 +1,42 @@ /* Copyright 2017-2018 ACSONE SA/NV * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ -odoo.define('report_py3o.report', function (require) { +odoo.define("report_py3o.report", function (require) { "use strict"; - var ActionManager = require('web.ActionManager'); + var ActionManager = require("web.ActionManager"); ActionManager.include({ _executeReportAction: function (action, options) { - // Py3o reports - if ('report_type' in action && action.report_type === 'py3o' ) { - return this._triggerDownload(action, options, 'py3o'); + // Py3o reports + if ("report_type" in action && action.report_type === "py3o") { + return this._triggerDownload(action, options, "py3o"); } return this._super.apply(this, arguments); - }, _makeReportUrls: function (action) { var reportUrls = this._super.apply(this, arguments); - reportUrls.py3o = '/report/py3o/' + action.report_name; + reportUrls.py3o = "/report/py3o/" + action.report_name; // We may have to build a query string with `action.data`. It's the place // were report's using a wizard to customize the output traditionally put // their options. - if (_.isUndefined(action.data) || _.isNull(action.data) || - _.isObject(action.data) && _.isEmpty(action.data)) { + if ( + _.isUndefined(action.data) || + _.isNull(action.data) || + _.isObject(action.data) && _.isEmpty(action.data) + ) { if (action.context.active_ids) { - var activeIDsPath = '/' + action.context.active_ids.join(','); + var activeIDsPath = "/" + action.context.active_ids.join(","); reportUrls.py3o += activeIDsPath; } } else { - var serializedOptionsPath = '?options=' + encodeURIComponent(JSON.stringify(action.data)); - serializedOptionsPath += '&context=' + encodeURIComponent(JSON.stringify(action.context)); + var serializedOptionsPath = + "?options=" + encodeURIComponent(JSON.stringify(action.data)); + serializedOptionsPath += + "&context=" + encodeURIComponent(JSON.stringify(action.context)); reportUrls.py3o += serializedOptionsPath; } return reportUrls; }, }); - }); diff --git a/report_py3o/views/ir_actions_report.xml b/report_py3o/views/ir_actions_report.xml index eae063325..d7dd54be9 100644 --- a/report_py3o/views/ir_actions_report.xml +++ b/report_py3o/views/ir_actions_report.xml @@ -1,51 +1,52 @@ - + - - py3o_report_view ir.actions.report - - + + - - + - + - + - - - py3o_report_search_view ir.actions.report - + - + - diff --git a/report_py3o/views/menu.xml b/report_py3o/views/menu.xml index 4ee9c005a..87385ecab 100644 --- a/report_py3o/views/menu.xml +++ b/report_py3o/views/menu.xml @@ -1,8 +1,4 @@ - + - - - + diff --git a/report_py3o/views/py3o_template.xml b/report_py3o/views/py3o_template.xml index 95f752d8e..f6f7be80a 100644 --- a/report_py3o/views/py3o_template.xml +++ b/report_py3o/views/py3o_template.xml @@ -1,6 +1,5 @@ - + - py3o.template.configuration.search.view py3o.template @@ -9,13 +8,15 @@ - + - py3o.template.configuration.form.view py3o.template @@ -29,7 +30,6 @@ - py3o.template.configuration.tree.view py3o.template @@ -40,15 +40,14 @@ - Py3o Templates py3o.template tree,form - - - + action="py3o_template_configuration_action" + /> diff --git a/report_py3o/views/report_py3o.xml b/report_py3o/views/report_py3o.xml index d2702a30d..41d28d45e 100644 --- a/report_py3o/views/report_py3o.xml +++ b/report_py3o/views/report_py3o.xml @@ -1,8 +1,11 @@ - + - +