mirror of
https://github.com/bringout/oca-report.git
synced 2026-04-19 04:42:01 +02:00
update all kept modules to OCA 19.0 versions
bi_sql_editor 19.0.1.0.1, report_csv 19.0.1.0.0,
report_qweb_element_page_visibility 19.0.1.0.0,
report_xlsx_helper 19.0.1.0.0, report_xml 19.0.1.0.0,
sql_request_abstract 19.0.1.0.0
🤖 assisted by claude
This commit is contained in:
parent
05df50b41d
commit
c18e7fd4c7
258 changed files with 8677 additions and 6341 deletions
|
|
@ -3,15 +3,16 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>XML Reports</title>
|
||||
<title>README.rst</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
|
||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
Despite the name, some widely supported CSS2 features are used.
|
||||
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
|
|
@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code .ln { color: gray; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
|
|
@ -300,7 +301,7 @@ span.option {
|
|||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
|
|
@ -359,74 +360,98 @@ ul.auto-toc {
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="xml-reports">
|
||||
<h1 class="title">XML Reports</h1>
|
||||
<div class="document">
|
||||
|
||||
|
||||
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
|
||||
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
|
||||
</a>
|
||||
<div class="section" id="xml-reports">
|
||||
<h1>XML Reports</h1>
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:e491947bf3954fb138e5655b09ea354d544b745eb63f3cec1d51df4a900595c6
|
||||
!! source digest: sha256:cdce2748ae7d4f6290504b3091f7dec2136dd8e984cb7f77cd1cc655d87033be
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/16.0/report_xml"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_xml"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module was written to extend the functionality of the reporting engine to
|
||||
support XML reports and allow modules to generate them by code or by QWeb
|
||||
templates.</p>
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/19.0/report_xml"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-19-0/reporting-engine-19-0-report_xml"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module was written to extend the functionality of the reporting
|
||||
engine to support XML reports and allow modules to generate them by code
|
||||
or by QWeb templates.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a><ul>
|
||||
<li><a class="reference internal" href="#if-you-are-a-developer" id="toc-entry-3">If you are a developer</a></li>
|
||||
<li><a class="reference internal" href="#use-cases-context" id="toc-entry-1">Use Cases / Context</a></li>
|
||||
<li><a class="reference internal" href="#installation" id="toc-entry-2">Installation</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="toc-entry-3">Usage</a><ul>
|
||||
<li><a class="reference internal" href="#if-you-are-a-developer" id="toc-entry-4">If you are a developer</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#other-credits" id="toc-entry-8">Other credits</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-9">Maintainers</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-5">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-6">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-7">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-8">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#other-credits" id="toc-entry-9">Other credits</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-10">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="use-cases-context">
|
||||
<h2><a class="toc-backref" href="#toc-entry-1">Use Cases / Context</a></h2>
|
||||
<p>We create this module to allow the system to generate and download XMLs
|
||||
as reports.</p>
|
||||
<p>Otherwise, the system can generate XMLs, but will be downloaded as HTML
|
||||
or PDF.</p>
|
||||
</div>
|
||||
<div class="section" id="installation">
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
|
||||
<h2><a class="toc-backref" href="#toc-entry-2">Installation</a></h2>
|
||||
<p>To install this module, you need to:</p>
|
||||
<ul class="simple">
|
||||
<li>Install <a class="reference external" href="http://lxml.de/">lxml</a> in Odoo’s <tt class="docutils literal">$PYTHONPATH</tt>.</li>
|
||||
<li>Install the repository <a class="reference external" href="https://github.com/OCA/reporting-engine">reporting-engine</a>.</li>
|
||||
<li>Install the repository
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine">reporting-engine</a>.</li>
|
||||
</ul>
|
||||
<p>But this module does nothing for the end user by itself, so if you have it
|
||||
installed it’s probably because there is another module that depends on it.</p>
|
||||
<p>But this module does nothing for the end user by itself, so if you have
|
||||
it installed it’s probably because there is another module that depends
|
||||
on it.</p>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
|
||||
<p>This module is intended as a base engine for other modules to use it, so no direct result if you are a user.</p>
|
||||
<h2><a class="toc-backref" href="#toc-entry-3">Usage</a></h2>
|
||||
<p>This module is intended as a base engine for other modules to use it, so
|
||||
no direct result if you are a user.</p>
|
||||
<div class="section" id="if-you-are-a-developer">
|
||||
<h2><a class="toc-backref" href="#toc-entry-3">If you are a developer</a></h2>
|
||||
<p>To learn from an example, just check the <a class="reference external" href="https://github.com/OCA/reporting-engine/blob/13.0/report_xml/demo/demo_report.xml">demo report</a> on GitHub for
|
||||
the model <tt class="docutils literal">res.company</tt> or check it in interface from companies views.</p>
|
||||
<h3><a class="toc-backref" href="#toc-entry-4">If you are a developer</a></h3>
|
||||
<p>To learn from an example, just check the <a class="reference external" href="https://github.com/OCA/reporting-engine/blob/13.0/report_xml/demo/demo_report.xml">demo
|
||||
report</a>
|
||||
on GitHub for the model <tt class="docutils literal">res.company</tt> or check it in interface from
|
||||
companies views.</p>
|
||||
<p>To develop with this module, you need to:</p>
|
||||
<ul class="simple">
|
||||
<li>Create a module.</li>
|
||||
<li>Make it depend on this one.</li>
|
||||
<li>Follow <a class="reference external" href="https://www.odoo.com/documentation/13.0/reference/reports.html">instructions to create reports</a> having in mind that the
|
||||
<tt class="docutils literal">report_type</tt> field in your <tt class="docutils literal">ir.actions.report</tt> record must be
|
||||
<tt class="docutils literal"><span class="pre">qweb-xml</span></tt>.</li>
|
||||
<li>Follow <a class="reference external" href="https://www.odoo.com/documentation/13.0/reference/reports.html">instructions to create
|
||||
reports</a>
|
||||
having in mind that the <tt class="docutils literal">report_type</tt> field in your
|
||||
<tt class="docutils literal">ir.actions.report</tt> record must be <tt class="docutils literal"><span class="pre">qweb-xml</span></tt>.</li>
|
||||
</ul>
|
||||
<p>In case you want to create a <a class="reference external" href="https://www.odoo.com/documentation/13.0/reference/reports.html#custom-reports">custom report</a>, the instructions remain the same
|
||||
as for HTML reports, and the method that you must override is also called
|
||||
<tt class="docutils literal">_get_report_values</tt>, even when this time you are creating a XML report.</p>
|
||||
<p>You can make your custom report inherit <tt class="docutils literal">report.report_xml.abstract</tt>, name
|
||||
it in such way <tt class="docutils literal"><span class="pre">report.<module.report_name></span></tt>. Also you can add a XSD file for
|
||||
report validation into <tt class="docutils literal">xsd_schema</tt> field of your report (check
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/blob/13.0/report_xml/demo/report.xml">report definition</a>) and have XSD automatic checking for
|
||||
free.</p>
|
||||
<p>You can customize rendering process and validation way via changing logic of
|
||||
<tt class="docutils literal">generate_report</tt> and <tt class="docutils literal">validate_report</tt> methods in your report class.</p>
|
||||
<p>You can visit <tt class="docutils literal"><span class="pre">http://<server-address>/report/xml/<module.report_name>/<ids></span></tt>
|
||||
to see your XML report online as a web page.</p>
|
||||
<p>In case you want to create a <a class="reference external" href="https://www.odoo.com/documentation/13.0/reference/reports.html#custom-reports">custom
|
||||
report</a>,
|
||||
the instructions remain the same as for HTML reports, and the method
|
||||
that you must override is also called <tt class="docutils literal">_get_report_values</tt>, even when
|
||||
this time you are creating a XML report.</p>
|
||||
<p>You can make your custom report inherit <tt class="docutils literal">report.report_xml.abstract</tt>,
|
||||
name it in such way <tt class="docutils literal"><span class="pre">report.<module.report_name></span></tt>. Also you can add a
|
||||
XSD file for report validation into <tt class="docutils literal">xsd_schema</tt> field of your report
|
||||
(check <a class="reference external" href="https://github.com/OCA/reporting-engine/blob/13.0/report_xml/demo/report.xml">report
|
||||
definition</a>)
|
||||
and have XSD automatic checking for free.</p>
|
||||
<p>You can customize rendering process and validation way via changing
|
||||
logic of <tt class="docutils literal">generate_report</tt> and <tt class="docutils literal">validate_report</tt> methods in your
|
||||
report class.</p>
|
||||
<p>You can visit
|
||||
<tt class="docutils literal"><span class="pre">http://<server-address>/report/xml/<module.report_name>/<ids></span></tt> to see
|
||||
your XML report online as a web page.</p>
|
||||
<p>For further information, please visit:</p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference external" href="https://www.odoo.com/forum/help-1">https://www.odoo.com/forum/help-1</a></li>
|
||||
|
|
@ -435,62 +460,60 @@ to see your XML report online as a web page.</p>
|
|||
</div>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Bug Tracker</a></h2>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_xml%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_xml%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
|
||||
<h2><a class="toc-backref" href="#toc-entry-6">Credits</a></h2>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
|
||||
<h3><a class="toc-backref" href="#toc-entry-7">Authors</a></h3>
|
||||
<ul class="simple">
|
||||
<li>Tecnativa</li>
|
||||
<li>Avoin.Systems</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
|
||||
<h3><a class="toc-backref" href="#toc-entry-8">Contributors</a></h3>
|
||||
<ul class="simple">
|
||||
<li>Enric Tobella <<a class="reference external" href="mailto:etobella@creublanca.es">etobella@creublanca.es</a>></li>
|
||||
<li><dl class="first docutils">
|
||||
<dt><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:</dt>
|
||||
<dd><ul class="first last">
|
||||
<li><a class="reference external" href="https://www.dixmit.com">Dixmit</a><ul>
|
||||
<li>Enric Tobella</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
||||
<li>Jairo Llopis</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><dl class="first docutils">
|
||||
<dt><a class="reference external" href="https://avoin.systems/">Avoin.Systems</a>:</dt>
|
||||
<dd><ul class="first last">
|
||||
<li><a class="reference external" href="https://avoin.systems/">Avoin.Systems</a>:<ul>
|
||||
<li>Tatiana Deribina</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li>Iván Antón <<a class="reference external" href="mailto:ozono@ozonomultimedia.com">ozono@ozonomultimedia.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="other-credits">
|
||||
<h2><a class="toc-backref" href="#toc-entry-8">Other credits</a></h2>
|
||||
<h3><a class="toc-backref" href="#toc-entry-9">Other credits</a></h3>
|
||||
<ul class="simple">
|
||||
<li>Icon taken from <a class="reference external" href="http://commons.wikimedia.org/wiki/File:Text-xml.svg">http://commons.wikimedia.org/wiki/File:Text-xml.svg</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
|
||||
<h3><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h3>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org">
|
||||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
||||
</a>
|
||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/16.0/report_xml">OCA/reporting-engine</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/19.0/report_xml">OCA/reporting-engine</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import {download} from "@web/core/network/download";
|
||||
import {registry} from "@web/core/registry";
|
||||
import {user} from "@web/core/user";
|
||||
|
||||
function getReportUrl({report_name, context, data}, env) {
|
||||
function getReportUrl({report_name, context, data}) {
|
||||
// Rough copy of action_service.js _getReportUrl method.
|
||||
let url = `/report/xml/${report_name}`;
|
||||
const actionContext = context || {};
|
||||
|
|
@ -15,14 +14,14 @@ function getReportUrl({report_name, context, data}, env) {
|
|||
if (actionContext.active_ids) {
|
||||
url += `/${actionContext.active_ids.join(",")}`;
|
||||
}
|
||||
const userContext = encodeURIComponent(JSON.stringify(env.services.user.context));
|
||||
const userContext = encodeURIComponent(JSON.stringify(user.context));
|
||||
return `${url}?context=${userContext}`;
|
||||
}
|
||||
async function triggerDownload(action, {onClose}, env) {
|
||||
// Rough copy of action_service.js _triggerDownload method.
|
||||
env.services.ui.block();
|
||||
const data = JSON.stringify([getReportUrl(action, env), action.report_type]);
|
||||
const context = JSON.stringify(env.services.user.context);
|
||||
const data = JSON.stringify([getReportUrl(action), action.report_type]);
|
||||
const context = JSON.stringify(user.context);
|
||||
try {
|
||||
await download({url: "/report/download", data: {data, context}});
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue