summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/graph/graph_view.js
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2018-04-05 13:53:59 +0200
committerGéry Debongnie <ged@odoo.com>2018-04-05 15:59:40 +0200
commit5144414a3a67d2c02989936831c792772361964c (patch)
treea5c01d800f65ef19ce99a716906d2393977a8777 /addons/web/static/src/js/views/graph/graph_view.js
parentb67331fc18109d013624e6c11ba52d0c61c17975 (diff)
[IMP] web: graph views can now aggregate many2ones
The read_group method was recently modified to allow more flexibility. With this commit, we add the possibility of aggregating many2one fields. These fields can be aggregating by counting the number of distinct IDs, directly in postgres. Also, note that we had to modify the mock server to implement the corresponding functionality.
Diffstat (limited to 'addons/web/static/src/js/views/graph/graph_view.js')
-rw-r--r--addons/web/static/src/js/views/graph/graph_view.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_view.js b/addons/web/static/src/js/views/graph/graph_view.js
index feb151b02e7..8cfe2dc0272 100644
--- a/addons/web/static/src/js/views/graph/graph_view.js
+++ b/addons/web/static/src/js/views/graph/graph_view.js
@@ -57,7 +57,7 @@ var GraphView = AbstractView.extend({
var measures = {__count__: {string: _t("Count"), type: "integer"}};
_.each(this.fields, function (field, name) {
if (name !== 'id' && field.store === true) {
- if (field.type === 'integer' || field.type === 'float' || field.type === 'monetary') {
+ if (field.type === 'integer' || field.type === 'float' || field.type === 'monetary' || field.type === 'many2one') {
measures[name] = field;
}
}