mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[MIG][13.0] report_xml: Migration to 13.0
This commit is contained in:
@@ -367,7 +367,7 @@ ul.auto-toc {
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/reporting-engine/tree/12.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" href="https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-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" href="https://runbot.odoo-community.org/runbot/143/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/reporting-engine/tree/13.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" href="https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-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" href="https://runbot.odoo-community.org/runbot/143/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-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>
|
||||
@@ -404,22 +404,25 @@ installed it’s probably because there is another module that depends on it.</p
|
||||
<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="#id3">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/tree/12.0/report_xml_sample">sample module</a>.</p>
|
||||
<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>.</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/12.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.xml</tt> record must be
|
||||
<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/12.0/reference/reports.html#custom-reports">custom report</a>, the instructions remain the same
|
||||
<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_xml.xsd_checked_report</tt>, name
|
||||
it like your XML <tt class="docutils literal"><template></tt> id prepended by <tt class="docutils literal">report.</tt>, add a <tt class="docutils literal">xsd()</tt>
|
||||
method that returns a XSD in a string, and have XSD automatic checking for
|
||||
<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>
|
||||
@@ -434,7 +437,7 @@ to see your XML report online as a web page.</p>
|
||||
<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 smashing 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:%2012.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:%2013.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">
|
||||
@@ -443,15 +446,28 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<h2><a class="toc-backref" href="#id6">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Tecnativa</li>
|
||||
<li>Avoin.Systems</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id7">Contributors</a></h2>
|
||||
<ul>
|
||||
<li><p class="first">Enric Tobella <<a class="reference external" href="mailto:etobella@creublanca.es">etobella@creublanca.es</a>></p>
|
||||
<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>Jairo Llopis</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><p class="first"><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:</p>
|
||||
<p>Jairo Llopis</p>
|
||||
<li><dl class="first docutils">
|
||||
<dt><a class="reference external" href="https://avoin.systems/">Avoin.Systems</a>:</dt>
|
||||
<dd><ul class="first last">
|
||||
<li>Tatiana Deribina</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -468,7 +484,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<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/12.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/13.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>
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
odoo.define('report_xml.ReportActionManager', function (require) {
|
||||
'use strict';
|
||||
odoo.define("report_xml.ReportActionManager", function(require) {
|
||||
"use strict";
|
||||
|
||||
var ActionManager = require('web.ActionManager');
|
||||
var ActionManager = require("web.ActionManager");
|
||||
|
||||
ActionManager.include({
|
||||
_executeReportAction: function (action, options) {
|
||||
if (action.report_type === 'qweb-xml') {
|
||||
return this._triggerDownload(action, options, 'xml');
|
||||
_executeReportAction: function(action, options) {
|
||||
if (action.report_type === "qweb-xml") {
|
||||
return this._triggerDownload(action, options, "xml");
|
||||
}
|
||||
return this._super(action, options);
|
||||
},
|
||||
_makeReportUrls: function (action) {
|
||||
_makeReportUrls: function(action) {
|
||||
var reportUrls = this._super(action);
|
||||
reportUrls.xml = reportUrls.text.replace(
|
||||
'/report/text/', '/report/xml/');
|
||||
reportUrls.xml = reportUrls.text.replace("/report/text/", "/report/xml/");
|
||||
return reportUrls;
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user