Browse Source

[IMP] : black, isort, prettier

14.0
Alex Cuellar 4 years ago
parent
commit
155d1e07cd
  1. 16
      report_xlsx/static/src/js/report/action_manager_report.js
  2. 1
      setup/report_xlsx/odoo/addons/report_xlsx
  3. 6
      setup/report_xlsx/setup.py

16
report_xlsx/static/src/js/report/action_manager_report.js

@ -1,6 +1,6 @@
// © 2017 Creu Blanca
// License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
odoo.define("report_xlsx.report", function(require) {
odoo.define("report_xlsx.report", function (require) {
"use strict";
var core = require("web.core");
@ -10,7 +10,7 @@ odoo.define("report_xlsx.report", function(require) {
var _t = core._t;
ActionManager.include({
_downloadReportXLSX: function(url, actions) {
_downloadReportXLSX: function (url, actions) {
var self = this;
framework.blockUI();
var type = "xlsx";
@ -34,14 +34,14 @@ odoo.define("report_xlsx.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: new_url,
data: {
data: JSON.stringify([new_url, type]),
},
success: resolve,
error: error => {
error: (error) => {
self.call("crash_manager", "rpc_error", error);
reject();
},
@ -61,12 +61,12 @@ odoo.define("report_xlsx.report", function(require) {
});
},
_triggerDownload: function(action, options, type) {
_triggerDownload: function (action, options, type) {
var self = this;
var reportUrls = this._makeReportUrls(action);
if (type === "xlsx") {
return this._downloadReportXLSX(reportUrls[type], action).then(
function() {
function () {
if (action.close_on_report_download) {
var closeAction = {type: "ir.actions.act_window_close"};
return self.doAction(
@ -81,13 +81,13 @@ odoo.define("report_xlsx.report", function(require) {
return this._super.apply(this, arguments);
},
_makeReportUrls: function(action) {
_makeReportUrls: function (action) {
var reportUrls = this._super.apply(this, arguments);
reportUrls.xlsx = "/report/xlsx/" + action.report_name;
return reportUrls;
},
_executeReportAction: function(action, options) {
_executeReportAction: function (action, options) {
var self = this;
if (action.report_type === "xlsx") {
return self._triggerDownload(action, options, "xlsx");

1
setup/report_xlsx/odoo/addons/report_xlsx

@ -0,0 +1 @@
../../../../report_xlsx

6
setup/report_xlsx/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading…
Cancel
Save