summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2017-11-27 15:02:40 +0100
committerMartin Geubelle <mge@odoo.com>2017-11-27 15:47:35 +0100
commitccaced9292174e468e4fa88d1bbb704002d07eb1 (patch)
treee026ca34220f4671e379d2e9fce0cf9b6736844d /addons/web/static/src
parent10de33a57e14d8e767411f474afe3b549cb8244b (diff)
[FIX] web: display selection label in graph
When grouping a graph view by a selection field, the labels on x axis were the selection values themselves (not their corresponding label). This issue was only present if there was only one group by field. In this case, the attribute `grouped_on` is not an array but a string containing the field name. This case wasn't correctly handled. Note that this issue is not present in the new views (from saas-16). Closes #19790
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/graph_widget.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/graph_widget.js b/addons/web/static/src/js/views/graph_widget.js
index 8e6a574a35d..d1452fed2b1 100644
--- a/addons/web/static/src/js/views/graph_widget.js
+++ b/addons/web/static/src/js/views/graph_widget.js
@@ -66,7 +66,8 @@ return Widget.extend({
values = [];
if (this.groupbys.length === 1) data_pt.value = [data_pt.value];
for (j = 0; j < data_pt.value.length; j++) {
- values[j] = this.sanitize_value(data_pt.value[j], data_pt.grouped_on[j]);
+ var field = _.isArray(data_pt.grouped_on) ? data_pt.grouped_on[j] : data_pt.grouped_on;
+ values[j] = this.sanitize_value(data_pt.value[j], field);
}
value = is_count ? data_pt.length : data_pt.aggregates[this.measure];
this.data.push({