summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-11-22 09:53:39 +0100
committerXavier Morel <xmo@openerp.com>2011-11-22 09:53:39 +0100
commite0d78df3373100acdddf646d199e8261c57f133e (patch)
tree64c708c577abd64ee74f86170214a8b16f9c31a0 /addons/web_graph/static/src
parent452eca8952e8cb5c343441b2c714b422734b8530 (diff)
parent36d244705895e492f0d3d4ea6741d6f566bb6875 (diff)
[FIX] incorrect handling of keys containing forward slashes in graph view
bzr revid: xmo@openerp.com-20111122085339-s05ky6wwzmrc6mcp
Diffstat (limited to 'addons/web_graph/static/src')
-rw-r--r--addons/web_graph/static/src/js/graph.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index f2af5503381..f940cac8b0b 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -187,7 +187,6 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
schedule_bar: function(results) {
var self = this;
-
var group_list, view_chart;
if (!this.group_field) {
view_chart = (this.orientation === 'horizontal') ? 'barH' : 'bar';
@@ -220,7 +219,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
.map(function (value, index) {
return {
group: self.ordinate + '_' +
- value.toLowerCase().replace(/\s/g, '_'),
+ value.toLowerCase().replace(/[\s\/]+/g,'_'),
text: value,
color: COLOR_PALETTE[index % COLOR_PALETTE.length]
};
@@ -235,21 +234,19 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
_(records).each(function (record) {
var key = _.str.sprintf('%s_%s',
self.ordinate,
- record[self.group_field].toLowerCase().replace(/\s/g, '_'));
+ record[self.group_field].toLowerCase().replace(/[\s\/]+/g,'_'));
r[key] = record[self.ordinate];
});
return r;
})
.value();
}
-
var abscissa_description = {
title: "<b>" + this.fields[this.abscissa].string + "</b>",
template: function (obj) {
return obj[self.abscissa] || 'Undefined';
}
};
-
var ordinate_description = {
lines: true,
title: "<b>" + this.fields[this.ordinate].string + "</b>"
@@ -263,7 +260,6 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
x_axis = abscissa_description;
y_axis = ordinate_description;
}
-
var renderer = function () {
if (self.$element.is(':hidden')) {
self.renderer = setTimeout(renderer, 100);