[IMP] web: allow using many2one as measure in pivot view

With this commit, we add the possibility of using many2ones as measure.
The way a many2one is aggregated is by using the count distinct
operator.

Some care had to be done to gracefully support the situation when a
pivot view is grouped by a m2o field F, and the same field F is used as
a measure.
This commit is contained in:
Mathieu Duckerts-Antoine
2018-04-10 17:41:12 +02:00
committed by Géry Debongnie
parent 742476fb20
commit 47395c6e51
6 changed files with 144 additions and 12 deletions
+1 -1
View File
@@ -527,7 +527,7 @@
</button>
<ul class="dropdown-menu o_pivot_measures_list">
<li t-foreach="measures" t-as="measure" t-att-data-field="measure[0]">
<a href="#"><t t-esc="measure[1].string"/></a>
<a href="#"><t t-esc="measure[1].string"/><t t-if="measure[1].type === 'many2one'"> (count)</t></a>
</li>
<li class="divider"></li>
<li data-field="__count"><a href="#">Count</a></li>