<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.svg">
</a>
<a name="zoom-in-pivot-views"></a>
<h2>Zoom in pivot views</h2>
<p>This module was written to allow your users to zoom into cells in pivot views
by simply clicking a cell in question.</p>
<a name="usage"></a>
<h3>Usage</h3>
<p>The module will simply open a list view of the underlying model. You can change
what happens here on a per view or measure basis:</p>
<ol class="arabic">
<li><p class="first">depend on this module</p>
</li>
<li><p class="first">in the graph element, declare an options dictionary as in
<a href="#id1"><span class="problematic" id="id2">``</span></a><graph type="pivot" options="{'web_pivot_zoom': {</p>
<blockquote>
<blockquote>
<p>'model': 'account.move.line',
'domain_map': {'user_type': 'account_id.user_type'}</p>
</blockquote>
<p>}}" />``</p>
</blockquote>
<p>to override the model to show, and to map field names in the report model
to field names/dotted paths of the custom model. The above for example makes
the accounting entries pivot work as expected.</p>
</li>
<li><p class="first">in your measure elements in your pivot view, declare an options dictionary
as in
<code><field name="field" type="measure" options="{'web_pivot_zoom': {}}" /></code></p>
<p>The options dictionary must have a key <code>model</code> to inform the module which
model should be shown, and can have a key <code>domain</code> for the domain to be
used. If you set no domain, the current cell's domain will be used, this
can be used to show rows from the pivot view's model.</p>
<p>The domain is subject to evaluation, so you can use the grouped values in
there. Note that if a field is not grouped, it will evaluate as <code>None</code>, so
the <code>=?</code> is your friend for expressions refering to the grouped fields.</p>
<p>Note that not all field types support the <code>=?</code> operator. For many2many
fields, you'd have to use a construction like
<code>('many2many_field', many2many_field and '=' or '!=', many2many_field)</code>
to simulate this to some degree.</p>
<p>Consult the demo data for an example, there, a graph view is added to the
users model, and clicking cells sends you to partners with the company in
question.</p>
</li>
</ol>
<p>Measures with a configuration enabling zooming will have a small link icon next to the column title.</p>
<a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/162/8.0"><img alt="Try me on Runbot" src="https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas" /></a>
<a name="roadmap"></a>
<h3>Roadmap</h3>
<ul class="simple">
<li>it might be convenient to be able to pass a window action's id</li>
</ul>
<a name="bug-tracker"></a>
<h3>Bug Tracker</h3>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/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 feedback.</p>
<a name="credits"></a>
<h3>Credits</h3>
<a name="images"></a>
<h4>Images</h4>
<ul class="simple">
<li>Odoo Community Association: <a class="reference external" href="https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg">Icon</a>.</li>
</ul>
<a name="contributors"></a>
<h4>Contributors</h4>
<ul class="simple">
<li>Holger Brunn <<a class="reference external" href="mailto:hbrunn@therp.nl">hbrunn@therp.nl</a>></li>
</ul>
<p>Do not contact contributors directly about help with questions or problems concerning this addon, but use the <a class="reference external" href="mailto:community@mail.odoo.com">community mailing list</a> or the <a class="reference external" href="https://odoo-community.org/groups">appropriate specialized mailinglist</a> for help, and the bug tracker linked in <a class="reference internal" href="#bug-tracker">Bug Tracker</a> above for technical issues.</p>
<a name="maintainer"></a>
<h4>Maintainer</h4>
<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>This module is maintained by the OCA.</p>
<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>To contribute to this module, please visit <a class="reference external" href="https://odoo-community.org">https://odoo-community.org</a>.</p>