Laurent Mignon (ACSONE)
4 years ago
committed by
default
6 changed files with 72 additions and 73 deletions
-
3report_py3o/demo/report_py3o.xml
-
27report_py3o/static/src/js/py3oactionmanager.js
-
27report_py3o/views/ir_actions_report.xml
-
6report_py3o/views/menu.xml
-
19report_py3o/views/py3o_template.xml
-
5report_py3o/views/report_py3o.xml
@ -1,39 +1,42 @@ |
|||||
/* Copyright 2017-2018 ACSONE SA/NV |
/* Copyright 2017-2018 ACSONE SA/NV |
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
* 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"; |
"use strict"; |
||||
|
|
||||
var ActionManager = require('web.ActionManager'); |
|
||||
|
var ActionManager = require("web.ActionManager"); |
||||
|
|
||||
ActionManager.include({ |
ActionManager.include({ |
||||
_executeReportAction: function (action, options) { |
_executeReportAction: function (action, options) { |
||||
// Py3o reports
|
// Py3o reports
|
||||
if ('report_type' in action && action.report_type === 'py3o' ) { |
|
||||
return this._triggerDownload(action, options, 'py3o'); |
|
||||
|
if ("report_type" in action && action.report_type === "py3o") { |
||||
|
return this._triggerDownload(action, options, "py3o"); |
||||
} |
} |
||||
return this._super.apply(this, arguments); |
return this._super.apply(this, arguments); |
||||
|
|
||||
}, |
}, |
||||
|
|
||||
_makeReportUrls: function (action) { |
_makeReportUrls: function (action) { |
||||
var reportUrls = this._super.apply(this, arguments); |
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
|
// 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
|
// were report's using a wizard to customize the output traditionally put
|
||||
// their options.
|
// 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) { |
if (action.context.active_ids) { |
||||
var activeIDsPath = '/' + action.context.active_ids.join(','); |
|
||||
|
var activeIDsPath = "/" + action.context.active_ids.join(","); |
||||
reportUrls.py3o += activeIDsPath; |
reportUrls.py3o += activeIDsPath; |
||||
} |
} |
||||
} else { |
} 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; |
reportUrls.py3o += serializedOptionsPath; |
||||
} |
} |
||||
return reportUrls; |
return reportUrls; |
||||
}, |
}, |
||||
}); |
}); |
||||
|
|
||||
}); |
}); |
@ -1,8 +1,4 @@ |
|||||
<?xml version="1.0" encoding="utf-8" ?> |
<?xml version="1.0" encoding="utf-8" ?> |
||||
<odoo> |
<odoo> |
||||
|
|
||||
<menuitem id="py3o_config_menu" |
|
||||
name="Py3o" |
|
||||
parent="base.reporting_menuitem" /> |
|
||||
|
|
||||
|
<menuitem id="py3o_config_menu" name="Py3o" parent="base.reporting_menuitem" /> |
||||
</odoo> |
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue