mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[FIX] report_py3o: prettier xml after merge with master
This commit is contained in:
committed by
Elmeri Niemelä
parent
16cf7466b9
commit
28897159f2
@@ -1,9 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- Copyright 2016 ACSONE SA/NV
|
<!-- Copyright 2016 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>
|
<odoo>
|
||||||
|
|
||||||
<record id="res_users_report_py3o" model="ir.actions.report">
|
<record id="res_users_report_py3o" model="ir.actions.report">
|
||||||
<field name="name">Py3o Demo Report</field>
|
<field name="name">Py3o Demo Report</field>
|
||||||
<field name="type">ir.actions.report</field>
|
<field name="type">ir.actions.report</field>
|
||||||
@@ -16,5 +14,4 @@
|
|||||||
<field name="binding_model_id" ref="base.model_res_users" />
|
<field name="binding_model_id" ref="base.model_res_users" />
|
||||||
<field name="binding_type">report</field>
|
<field name="binding_type">report</field>
|
||||||
</record>
|
</record>
|
||||||
|
</odoo>
|
||||||
</odoo>
|
|
||||||
|
|||||||
@@ -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' ) {
|
if ("report_type" in action && action.report_type === "py3o") {
|
||||||
return this._triggerDownload(action, options, '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) ||
|
if (
|
||||||
_.isObject(action.data) && _.isEmpty(action.data)) {
|
_.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));
|
var serializedOptionsPath =
|
||||||
serializedOptionsPath += '&context=' + encodeURIComponent(JSON.stringify(action.context));
|
"?options=" + encodeURIComponent(JSON.stringify(action.data));
|
||||||
|
serializedOptionsPath +=
|
||||||
|
"&context=" + encodeURIComponent(JSON.stringify(action.context));
|
||||||
reportUrls.py3o += serializedOptionsPath;
|
reportUrls.py3o += serializedOptionsPath;
|
||||||
}
|
}
|
||||||
return reportUrls;
|
return reportUrls;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,51 +1,52 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<!-- Inherit from base.act_report_xml_view to add py3o-related settings. -->
|
<!-- Inherit from base.act_report_xml_view to add py3o-related settings. -->
|
||||||
|
|
||||||
<record id="py3o_report_view" model="ir.ui.view">
|
<record id="py3o_report_view" model="ir.ui.view">
|
||||||
<field name="name">py3o_report_view</field>
|
<field name="name">py3o_report_view</field>
|
||||||
<field name="model">ir.actions.report</field>
|
<field name="model">ir.actions.report</field>
|
||||||
<field name="inherit_id" ref="base.act_report_xml_view" />
|
<field name="inherit_id" ref="base.act_report_xml_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="/form/field[1]" position="before">
|
<xpath expr="/form/field[1]" position="before">
|
||||||
<field name="is_py3o_report_not_available" invisible="1"/>
|
<field name="is_py3o_report_not_available" invisible="1" />
|
||||||
<div class="alert alert-danger"
|
<div
|
||||||
|
class="alert alert-danger"
|
||||||
role="alert"
|
role="alert"
|
||||||
style="margin-bottom:0px;"
|
style="margin-bottom:0px;"
|
||||||
attrs="{'invisible': [('is_py3o_report_not_available','=',False)]}">
|
attrs="{'invisible': [('is_py3o_report_not_available','=',False)]}"
|
||||||
<field name="msg_py3o_report_not_available"/>
|
>
|
||||||
|
<field name="msg_py3o_report_not_available" />
|
||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page[@name='security']" position="before">
|
<xpath expr="//page[@name='security']" position="before">
|
||||||
<page string="LibreOffice Template" name="py3o_tab"
|
<page
|
||||||
attrs="{'invisible': [('report_type', '!=', 'py3o')]}">
|
string="LibreOffice Template"
|
||||||
|
name="py3o_tab"
|
||||||
|
attrs="{'invisible': [('report_type', '!=', 'py3o')]}"
|
||||||
|
>
|
||||||
<group name="py3o_params">
|
<group name="py3o_params">
|
||||||
<field name="lo_bin_path"/>
|
<field name="lo_bin_path" />
|
||||||
<field name="py3o_filetype" />
|
<field name="py3o_filetype" />
|
||||||
<field name="py3o_multi_in_one"/>
|
<field name="py3o_multi_in_one" />
|
||||||
<field name="py3o_template_id" />
|
<field name="py3o_template_id" />
|
||||||
<field name="module" />
|
<field name="module" />
|
||||||
<field name="py3o_template_fallback" />
|
<field name="py3o_template_fallback" />
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
</page>
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="act_report_xml_search_view" model="ir.ui.view">
|
<record id="act_report_xml_search_view" model="ir.ui.view">
|
||||||
<field name="name">py3o_report_search_view</field>
|
<field name="name">py3o_report_search_view</field>
|
||||||
<field name="model">ir.actions.report</field>
|
<field name="model">ir.actions.report</field>
|
||||||
<field name="inherit_id" ref="base.act_report_xml_search_view"/>
|
<field name="inherit_id" ref="base.act_report_xml_search_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="model" position="after">
|
<field name="model" position="after">
|
||||||
<filter name="py3o" string="Py3o Reports"
|
<filter
|
||||||
domain="[('report_type', '=', 'py3o')]"/>
|
name="py3o"
|
||||||
|
string="Py3o Reports"
|
||||||
|
domain="[('report_type', '=', 'py3o')]"
|
||||||
|
/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record id="py3o_template_configuration_search_view" model="ir.ui.view">
|
<record id="py3o_template_configuration_search_view" model="ir.ui.view">
|
||||||
<field name="name">py3o.template.configuration.search.view</field>
|
<field name="name">py3o.template.configuration.search.view</field>
|
||||||
<field name="model">py3o.template</field>
|
<field name="model">py3o.template</field>
|
||||||
@@ -9,13 +8,15 @@
|
|||||||
<field name="name" />
|
<field name="name" />
|
||||||
<field name="filetype" />
|
<field name="filetype" />
|
||||||
<group string="Group By" name="groupby">
|
<group string="Group By" name="groupby">
|
||||||
<filter name="filetype_groupby" string="File Type"
|
<filter
|
||||||
context="{'group_by': 'filetype'}"/>
|
name="filetype_groupby"
|
||||||
|
string="File Type"
|
||||||
|
context="{'group_by': 'filetype'}"
|
||||||
|
/>
|
||||||
</group>
|
</group>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="py3o_template_configuration_form_view" model="ir.ui.view">
|
<record id="py3o_template_configuration_form_view" model="ir.ui.view">
|
||||||
<field name="name">py3o.template.configuration.form.view</field>
|
<field name="name">py3o.template.configuration.form.view</field>
|
||||||
<field name="model">py3o.template</field>
|
<field name="model">py3o.template</field>
|
||||||
@@ -29,7 +30,6 @@
|
|||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="py3o_template_configuration_tree_view" model="ir.ui.view">
|
<record id="py3o_template_configuration_tree_view" model="ir.ui.view">
|
||||||
<field name="name">py3o.template.configuration.tree.view</field>
|
<field name="name">py3o.template.configuration.tree.view</field>
|
||||||
<field name="model">py3o.template</field>
|
<field name="model">py3o.template</field>
|
||||||
@@ -40,15 +40,14 @@
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="py3o_template_configuration_action" model="ir.actions.act_window">
|
<record id="py3o_template_configuration_action" model="ir.actions.act_window">
|
||||||
<field name="name">Py3o Templates</field>
|
<field name="name">Py3o Templates</field>
|
||||||
<field name="res_model">py3o.template</field>
|
<field name="res_model">py3o.template</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
</record>
|
</record>
|
||||||
|
<menuitem
|
||||||
<menuitem id="py3o_template_configuration_menu"
|
id="py3o_template_configuration_menu"
|
||||||
parent="py3o_config_menu"
|
parent="py3o_config_menu"
|
||||||
action="py3o_template_configuration_action" />
|
action="py3o_template_configuration_action"
|
||||||
|
/>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<template id="assets_backend" name="report assets" inherit_id="web.assets_backend">
|
<template id="assets_backend" name="report assets" inherit_id="web.assets_backend">
|
||||||
<xpath expr="." position="inside">
|
<xpath expr="." position="inside">
|
||||||
<script type="text/javascript" src="/report_py3o/static/src/js/py3oactionmanager.js"></script>
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="/report_py3o/static/src/js/py3oactionmanager.js"
|
||||||
|
/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user