Search 1.9 billion lines of Odoo code on GitHub

report_code_data

Author: CreuBlanca,Odoo Community Association (OCA)
License: AGPL-3
Branch: 13.0-add-report_code_data
Repository: tegin/reporting-engine
Dependencies: base
Languages: HTML (316, 79.6%), Python (33, 8.3%), XML (15, 3.8%), and reStructuredText (33, 8.3%)

<h1 class="title">Report Code Data</h1> <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/tegin/reporting_engine/tree/13.0/report_code_data"><img alt="tegin/reporting_engine" src="https://img.shields.io/badge/github-tegin%2Freporting_engine-lightgray.png?logo=github" /></a></p> <p>This module allows to add extra data when rendering a report. For example, if we want to use an extra field not defined in the model. It would also be useful when using py3o, as complex behaviors are not valid, for example, filtering, adding conditions...</p> <p>The field code data must be written with python and it must save a dict in a variable named &quot;result. It can access the records using the &quot;records&quot; variable and the ir.actions.report record using the variable &quot;self&quot;. Example of code_data:</p> <pre> <code lang="python">result = { &quot;field_a&quot;: records.field_1 if records.state == &quot;draft&quot; else records.field_2 }</code> </pre> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id2">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id3">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li> </ul> </li> </ul> </div> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id1">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/tegin/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/tegin/reporting_engine/issues/new?body=module:%20report_code_data%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> <a name="credits"></a> <h2><a class="toc-backref" href="#id2">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id3">Authors</a></h3> <ul class="simple"> <li>CreuBlanca</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id4">Contributors</a></h3> <ul class="simple"> <li>Enric Tobella &lt;<a class="reference external" href="mailto:etobella&#64;creublanca.es">etobella&#64;creublanca.es</a>&gt;</li> <li>Alba Riera &lt;<a class="reference external" href="mailto:alba.riera&#64;creublanca.es">alba.riera&#64;creublanca.es</a>&gt;</li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id5">Maintainers</a></h3> <p>This module is part of the <a class="reference external" href="https://github.com/tegin/reporting_engine/tree/13.0/report_code_data">tegin/reporting_engine</a> project on GitHub.</p> <p>You are welcome to contribute.</p>