Laurent Mignon (ACSONE)
5 years ago
13 changed files with 41 additions and 74 deletions
-
2.isort.cfg
-
1.travis.yml
-
2report_py3o/__manifest__.py
-
BINreport_py3o/demo/res_user.odt
-
11report_py3o/migrations/10.0.2.0.0/pre-migration.py
-
7report_py3o/models/ir_actions_report.py
-
15report_py3o/models/py3o_report.py
-
55report_py3o/static/src/js/py3oactionmanager.js
-
6report_py3o/views/report_py3o.xml
-
2report_py3o_fusion_server/__manifest__.py
-
5report_py3o_fusion_server/models/ir_actions_report.py
-
6report_py3o_fusion_server/models/py3o_report.py
-
3requirements.txt
@ -1,11 +0,0 @@ |
|||
# © 2018 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
def migrate(cr, version=None): |
|||
# when migrating from a pre-split version of the module, pull the fusion |
|||
# server module too to have no loss of features |
|||
cr.execute( |
|||
"update ir_module_module set state='to install' " |
|||
"where name='report_py3o_fusion_server' and state='uninstalled'" |
|||
) |
@ -1,38 +1,39 @@ |
|||
/* 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) { |
|||
"use strict"; |
|||
|
|||
var ActionManager = require('web.ActionManager'); |
|||
var ActionManager = require('web.ActionManager'); |
|||
|
|||
ActionManager.include({ |
|||
_executeReportAction: function (action, options) { |
|||
ActionManager.include({ |
|||
_executeReportAction: function (action, options) { |
|||
// Py3o reports
|
|||
if ('report_type' in action && action.report_type === 'py3o' ) { |
|||
return this._triggerDownload(action, options, 'py3o'); |
|||
} else { |
|||
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; |
|||
// 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 (action.context.active_ids) { |
|||
var activeIDsPath = '/' + action.context.active_ids.join(','); |
|||
reportUrls.py3o += activeIDsPath;; |
|||
}, |
|||
|
|||
_makeReportUrls: function (action) { |
|||
var reportUrls = this._super.apply(this, arguments); |
|||
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 (action.context.active_ids) { |
|||
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)); |
|||
reportUrls.py3o += serializedOptionsPath; |
|||
} |
|||
} else { |
|||
var serializedOptionsPath = '?options=' + encodeURIComponent(JSON.stringify(action.data)); |
|||
serializedOptionsPath += '&context=' + encodeURIComponent(JSON.stringify(action.context)); |
|||
reportUrls.py3o += serializedOptionsPath; |
|||
} |
|||
return reportUrls; |
|||
} |
|||
}); |
|||
return reportUrls; |
|||
}, |
|||
}); |
|||
|
|||
}); |
@ -1,10 +1,8 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<odoo> |
|||
<template id="assets_backend" name="report assets" inherit_id="web.assets_backend"> |
|||
<xpath expr="." position="inside"> |
|||
<script type="text/javascript" src="/report_py3o/static/src/js/py3oactionmanager.js"></script> |
|||
</xpath> |
|||
</template> |
|||
</data> |
|||
</openerp> |
|||
</odoo> |
@ -0,0 +1,3 @@ |
|||
py3o.template |
|||
py3o.formats |
|||
genshi>=0.7 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue