summaryrefslogtreecommitdiff
path: root/addons/web_graph
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2014-08-13 17:33:34 +0200
committerOlivier Dony <odo@openerp.com>2014-08-13 17:34:27 +0200
commit2a94d1d8117847ef2cd1f904de3fe1b4c45779f6 (patch)
treefdd396b7f4d223d7cdff19244b16376530b2f5ec /addons/web_graph
parentca55a2437444cf3e5231ee8edff9e60049da38ba (diff)
parent2694ed1472c987d8b4e713f62183d5ecd419c58c (diff)
[MERGE] Forward-port saas-4 up to 2694ed1
Diffstat (limited to 'addons/web_graph')
-rw-r--r--addons/web_graph/static/src/js/pivot_table.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/web_graph/static/src/js/pivot_table.js b/addons/web_graph/static/src/js/pivot_table.js
index 086e7205990..b842b00f00d 100644
--- a/addons/web_graph/static/src/js/pivot_table.js
+++ b/addons/web_graph/static/src/js/pivot_table.js
@@ -423,14 +423,15 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
attrs.value = [attrs.value];
}
attrs.value = _.range(grouped_on.length).map(function (i) {
+ var grp = grouped_on[i],
+ field = self.fields[grp];
if (attrs.value[i] === false) {
return _t('Undefined');
} else if (attrs.value[i] instanceof Array) {
return attrs.value[i][1];
- }else if (grouped_on && self.fields[grouped_on].type === 'selection'){
- var selection = self.fields[grouped_on].selection;
- var value_lookup = _.where(selection, {0:attrs.value[i]});
- return value_lookup ? value_lookup[0][1] : _t('Undefined');
+ } else if (field && field.type === 'selection') {
+ var selected = _.where(field.selection, {0: attrs.value[i]})[0];
+ return selected ? selected[1] : attrs.value[i];
}
return attrs.value[i];
});