2011-04-15 06:42:41 +00:00
|
|
|
/*---------------------------------------------------------
|
2011-09-05 12:28:15 +00:00
|
|
|
* OpenERP web_graph
|
2011-04-15 06:42:41 +00:00
|
|
|
*---------------------------------------------------------*/
|
|
|
|
|
2012-04-17 12:48:30 +00:00
|
|
|
openerp.web_graph = function (instance) {
|
2011-06-17 13:25:50 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
var _lt = instance.web._lt;
|
2012-05-07 08:19:08 +00:00
|
|
|
|
2012-06-07 15:46:45 +00:00
|
|
|
// removed ``undefined`` values
|
|
|
|
var filter_values = function (o) {
|
|
|
|
var out = {};
|
|
|
|
for (var k in o) {
|
|
|
|
if (!o.hasOwnProperty(k) || o[k] === undefined) { continue; }
|
|
|
|
out[k] = o[k];
|
|
|
|
}
|
|
|
|
return out;
|
|
|
|
};
|
|
|
|
|
2012-04-17 12:48:30 +00:00
|
|
|
instance.web.views.add('graph', 'instance.web_graph.GraphView');
|
|
|
|
instance.web_graph.GraphView = instance.web.View.extend({
|
2012-05-07 13:38:21 +00:00
|
|
|
template: "GraphView",
|
2011-12-16 13:00:00 +00:00
|
|
|
display_name: _lt('Graph'),
|
2012-04-05 16:03:15 +00:00
|
|
|
view_type: "graph",
|
2011-04-15 06:42:41 +00:00
|
|
|
|
2011-10-07 15:21:16 +00:00
|
|
|
init: function(parent, dataset, view_id, options) {
|
2012-10-18 11:49:50 +00:00
|
|
|
var self = this;
|
2011-09-15 09:49:44 +00:00
|
|
|
this._super(parent);
|
2011-10-07 15:21:16 +00:00
|
|
|
this.set_default_options(options);
|
2011-04-15 06:42:41 +00:00
|
|
|
this.dataset = dataset;
|
|
|
|
this.view_id = view_id;
|
2011-09-28 12:45:42 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
this.mode = "bar"; // line, bar, area, pie, radar
|
|
|
|
this.orientation = false; // true: horizontal, false: vertical
|
|
|
|
this.stacked = true;
|
2012-05-07 09:40:59 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
this.spreadsheet = false; // Display data grid, allows copy to CSV
|
|
|
|
this.forcehtml = false;
|
|
|
|
this.legend = "top"; // top, inside, no
|
2012-05-07 08:19:08 +00:00
|
|
|
|
2012-05-07 15:55:01 +00:00
|
|
|
this.domain = [];
|
|
|
|
this.context = {};
|
2012-06-07 14:17:12 +00:00
|
|
|
this.group_by = [];
|
2012-05-07 15:55:01 +00:00
|
|
|
|
2012-05-07 13:38:21 +00:00
|
|
|
this.graph = null;
|
2012-10-18 11:49:50 +00:00
|
|
|
this.on('view_loaded', self, self.load_graph);
|
2011-10-28 12:26:08 +00:00
|
|
|
},
|
2012-02-21 16:29:12 +00:00
|
|
|
destroy: function () {
|
2012-06-07 14:17:12 +00:00
|
|
|
if (this.graph) {
|
2012-05-07 13:38:21 +00:00
|
|
|
this.graph.destroy();
|
2012-06-07 14:17:12 +00:00
|
|
|
}
|
2011-10-28 12:26:08 +00:00
|
|
|
this._super();
|
2011-04-15 06:42:41 +00:00
|
|
|
},
|
2012-05-07 08:19:08 +00:00
|
|
|
|
2012-10-18 11:49:50 +00:00
|
|
|
load_graph: function(fields_view_get) {
|
2012-05-07 13:38:21 +00:00
|
|
|
// TODO: move to load_view and document
|
|
|
|
var self = this;
|
|
|
|
this.fields_view = fields_view_get;
|
2012-08-24 18:27:07 +00:00
|
|
|
this.$el.addClass(this.fields_view.arch.attrs['class']);
|
2012-05-07 15:04:50 +00:00
|
|
|
|
2012-05-07 22:45:30 +00:00
|
|
|
this.mode = this.fields_view.arch.attrs.type || 'bar';
|
|
|
|
this.orientation = this.fields_view.arch.attrs.orientation == 'horizontal';
|
|
|
|
|
2012-08-24 18:27:07 +00:00
|
|
|
var width = this.$el.parent().width();
|
|
|
|
this.$el.css("width", width);
|
|
|
|
this.container = this.$el.find("#editor-render-body").css({
|
2012-06-07 14:17:12 +00:00
|
|
|
width: width,
|
|
|
|
height: Math.min(500, width * 0.8)
|
|
|
|
})[0];
|
2012-05-07 15:04:50 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
var graph_render = this.proxy('graph_render');
|
2012-08-24 18:27:07 +00:00
|
|
|
this.$el.on('click', '.oe_graph_options a', function (evt) {
|
2012-06-07 15:46:45 +00:00
|
|
|
var $el = $(evt.target);
|
|
|
|
|
|
|
|
self.graph_render({data: filter_values({
|
|
|
|
mode: $el.data('mode'),
|
|
|
|
legend: $el.data('legend'),
|
|
|
|
orientation: $el.data('orientation'),
|
|
|
|
stacked: $el.data('stacked')
|
|
|
|
})});
|
|
|
|
});
|
2012-06-07 14:17:12 +00:00
|
|
|
|
2012-08-24 18:27:07 +00:00
|
|
|
this.$el.find("#graph_show_data").click(function () {
|
2012-06-07 14:17:12 +00:00
|
|
|
self.spreadsheet = ! self.spreadsheet;
|
|
|
|
self.graph_render();
|
|
|
|
});
|
2012-08-24 18:27:07 +00:00
|
|
|
this.$el.find("#graph_switch").click(function () {
|
2012-06-07 14:17:12 +00:00
|
|
|
if (self.mode != 'radar') {
|
|
|
|
self.orientation = ! self.orientation;
|
2012-05-07 09:40:59 +00:00
|
|
|
}
|
2012-06-07 14:17:12 +00:00
|
|
|
self.graph_render();
|
|
|
|
});
|
|
|
|
|
2012-08-24 18:27:07 +00:00
|
|
|
this.$el.find("#graph_download").click(function () {
|
2012-06-07 14:17:12 +00:00
|
|
|
if (self.legend == "top") { self.legend = "inside"; }
|
|
|
|
self.forcehtml = true;
|
|
|
|
|
2012-10-30 14:06:30 +00:00
|
|
|
self.graph_get_data().done(function (result) {
|
2012-06-07 14:17:12 +00:00
|
|
|
self.graph_render_all(result).download.saveImage('png');
|
|
|
|
}).always(function () {
|
|
|
|
self.forcehtml = false;
|
|
|
|
});
|
|
|
|
});
|
2012-10-18 11:49:50 +00:00
|
|
|
this.trigger('graph_view_loaded', fields_view_get);
|
2011-04-15 06:42:41 +00:00
|
|
|
},
|
2012-05-07 09:40:59 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
get_format: function (options) {
|
|
|
|
options = options || {};
|
|
|
|
var legend = {
|
|
|
|
show: this.legend != 'no',
|
|
|
|
};
|
|
|
|
|
|
|
|
switch (this.legend) {
|
|
|
|
case 'top':
|
|
|
|
legend.noColumns = 4;
|
2012-08-24 18:27:07 +00:00
|
|
|
legend.container = this.$el.find("div.graph_header_legend")[0];
|
2012-06-07 14:17:12 +00:00
|
|
|
break;
|
|
|
|
case 'inside':
|
|
|
|
legend.position = 'nw';
|
|
|
|
legend.backgroundColor = '#D2E8FF';
|
|
|
|
break;
|
2011-09-29 07:51:26 +00:00
|
|
|
}
|
2012-06-07 14:17:12 +00:00
|
|
|
|
|
|
|
return _.extend({
|
|
|
|
legend: legend,
|
2012-05-07 09:40:59 +00:00
|
|
|
mouse: {
|
|
|
|
track: true,
|
|
|
|
relative: true
|
|
|
|
},
|
|
|
|
spreadsheet : {
|
|
|
|
show: this.spreadsheet,
|
|
|
|
initialTab: "data"
|
|
|
|
},
|
2012-06-07 14:17:12 +00:00
|
|
|
HtmlText : (options.xaxis && options.xaxis.labelsAngle) ? false : !this.forcehtml,
|
|
|
|
}, options);
|
2011-09-29 07:51:26 +00:00
|
|
|
},
|
2012-05-07 09:40:59 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
make_graph: function (mode, container, data) {
|
|
|
|
if (mode === 'area') { mode = 'line'; }
|
|
|
|
return Flotr.draw(
|
|
|
|
container, data.data,
|
|
|
|
this.get_format(this['options_' + mode](data)));
|
2012-05-07 09:40:59 +00:00
|
|
|
},
|
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
options_bar: function (data) {
|
2012-06-08 07:03:12 +00:00
|
|
|
var min = _(data.data).chain()
|
|
|
|
.map(function (record) {
|
2012-09-11 08:15:59 +00:00
|
|
|
if (record.data.length > 0){
|
|
|
|
return _.min(record.data, function (item) {
|
|
|
|
return item[1];
|
|
|
|
})[1];
|
|
|
|
}
|
2012-06-08 07:03:12 +00:00
|
|
|
}).min().value();
|
2012-06-07 14:17:12 +00:00
|
|
|
return {
|
|
|
|
bars : {
|
|
|
|
show : true,
|
|
|
|
stacked : this.stacked,
|
|
|
|
horizontal : this.orientation,
|
|
|
|
barWidth : 0.7,
|
|
|
|
lineWidth : 1
|
|
|
|
},
|
|
|
|
grid : {
|
|
|
|
verticalLines : this.orientation,
|
|
|
|
horizontalLines : !this.orientation,
|
|
|
|
outline : "sw",
|
|
|
|
},
|
|
|
|
yaxis : {
|
2012-06-08 07:03:12 +00:00
|
|
|
ticks: this.orientation ? data.ticks : false,
|
|
|
|
min: !this.orientation ? (min < 0 ? min : 0) : null
|
2012-06-07 14:17:12 +00:00
|
|
|
},
|
|
|
|
xaxis : {
|
|
|
|
labelsAngle: 45,
|
2012-06-08 07:03:12 +00:00
|
|
|
ticks: this.orientation ? false : data.ticks,
|
|
|
|
min: this.orientation ? (min < 0 ? min : 0) : null
|
2012-06-07 14:17:12 +00:00
|
|
|
}
|
|
|
|
};
|
2012-05-07 10:34:07 +00:00
|
|
|
},
|
2012-05-07 09:40:59 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
options_pie: function (data) {
|
|
|
|
return {
|
|
|
|
pie : {
|
|
|
|
show: true
|
|
|
|
},
|
|
|
|
grid : {
|
|
|
|
verticalLines : false,
|
|
|
|
horizontalLines : false,
|
|
|
|
outline : "",
|
|
|
|
},
|
|
|
|
xaxis : {showLabels: false},
|
|
|
|
yaxis : {showLabels: false},
|
|
|
|
};
|
2012-05-07 10:34:07 +00:00
|
|
|
},
|
2012-05-07 09:40:59 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
options_radar: function (data) {
|
|
|
|
return {
|
|
|
|
radar : {
|
|
|
|
show : true,
|
|
|
|
stacked : this.stacked
|
|
|
|
},
|
|
|
|
grid : {
|
|
|
|
circular : true,
|
|
|
|
minorHorizontalLines : true
|
|
|
|
},
|
|
|
|
xaxis : {
|
|
|
|
ticks: data.ticks
|
|
|
|
},
|
|
|
|
};
|
2012-05-07 10:34:07 +00:00
|
|
|
},
|
2012-05-07 09:40:59 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
options_line: function (data) {
|
|
|
|
return {
|
|
|
|
lines : {
|
|
|
|
show : true,
|
|
|
|
stacked : this.stacked
|
|
|
|
},
|
|
|
|
grid : {
|
|
|
|
verticalLines : this.orientation,
|
|
|
|
horizontalLines : !this.orientation,
|
|
|
|
outline : "sw",
|
|
|
|
},
|
|
|
|
yaxis : {
|
|
|
|
ticks: this.orientation ? data.ticks : false
|
|
|
|
},
|
|
|
|
xaxis : {
|
|
|
|
labelsAngle: 45,
|
|
|
|
ticks: this.orientation ? false : data.ticks
|
|
|
|
}
|
|
|
|
};
|
2012-05-07 21:06:43 +00:00
|
|
|
},
|
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
graph_get_data: function () {
|
2012-10-23 14:58:58 +00:00
|
|
|
var model = this.dataset.model,
|
2012-10-23 15:11:23 +00:00
|
|
|
domain = new instance.web.CompoundDomain(this.domain || []),
|
|
|
|
context = new instance.web.CompoundContext(this.context || {}),
|
|
|
|
group_by = this.group_by || [],
|
|
|
|
view_id = this.view_id || false,
|
|
|
|
mode = this.mode || 'bar',
|
|
|
|
orientation = this.orientation || false,
|
|
|
|
stacked = this.stacked || false;
|
2012-10-23 14:58:58 +00:00
|
|
|
|
|
|
|
var obj = new instance.web.Model(model);
|
|
|
|
var view_get;
|
|
|
|
var fields;
|
|
|
|
var result = [];
|
|
|
|
var ticks = {};
|
|
|
|
|
2012-10-30 14:06:30 +00:00
|
|
|
return obj.call("fields_view_get", [view_id, 'graph']).then(function(tmp) {
|
2012-10-23 14:58:58 +00:00
|
|
|
view_get = tmp;
|
|
|
|
fields = view_get['fields'];
|
|
|
|
var toload = _.select(group_by, function(x) { return fields[x] === undefined });
|
|
|
|
if (toload.length >= 1)
|
|
|
|
return obj.call("fields_get", [toload, context]);
|
|
|
|
else
|
|
|
|
return $.when([]);
|
2012-10-30 14:06:30 +00:00
|
|
|
}).then(function (fields_to_add) {
|
2012-10-23 14:58:58 +00:00
|
|
|
_.extend(fields, fields_to_add);
|
|
|
|
|
|
|
|
var tree = $($.parseXML(view_get['arch']));
|
|
|
|
|
|
|
|
var pos = 0;
|
|
|
|
var xaxis = group_by || [];
|
|
|
|
var yaxis = [];
|
|
|
|
tree.find("field").each(function() {
|
|
|
|
var field = $(this);
|
|
|
|
if (! field.attr("name"))
|
|
|
|
return;
|
2012-10-23 15:11:23 +00:00
|
|
|
if ((group_by.length == 0) && ((! pos) || field.attr('group'))) {
|
2012-10-23 14:58:58 +00:00
|
|
|
xaxis.push(field.attr('name'));
|
|
|
|
}
|
|
|
|
if (pos && ! field.attr('group')) {
|
|
|
|
yaxis.push(field.attr('name'));
|
|
|
|
}
|
|
|
|
pos += 1;
|
|
|
|
});
|
|
|
|
|
|
|
|
if (xaxis.length === 0)
|
|
|
|
throw new Error("No field for the X axis!");
|
|
|
|
if (yaxis.length === 0)
|
|
|
|
throw new Error("No field for the Y axis!");
|
|
|
|
|
|
|
|
// Convert a field's data into a displayable string
|
|
|
|
|
|
|
|
function _convert_key(field, data) {
|
|
|
|
if (fields[field]['type'] === 'many2one')
|
|
|
|
data = data && data[0];
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
function _convert(field, data, tick) {
|
|
|
|
tick = tick === undefined ? true : false;
|
2012-10-25 12:25:06 +00:00
|
|
|
try {
|
|
|
|
data = instance.web.format_value(data, fields[field]);
|
|
|
|
} catch(e) {
|
|
|
|
data = "" + data;
|
|
|
|
}
|
2012-10-23 14:58:58 +00:00
|
|
|
if (tick) {
|
|
|
|
if (ticks[data] === undefined)
|
|
|
|
ticks[data] = _.size(ticks);
|
|
|
|
return ticks[data];
|
|
|
|
}
|
|
|
|
return data || 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
function _orientation(x, y) {
|
|
|
|
if (! orientation)
|
|
|
|
return [x, y]
|
|
|
|
return [y, x]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mode === "pie") {
|
2012-10-30 14:06:30 +00:00
|
|
|
return obj.call("read_group", [domain, yaxis.concat([xaxis[0]]), [xaxis[0]]], {context: context}).then(function(res) {
|
2012-10-23 14:58:58 +00:00
|
|
|
_.each(res, function(record) {
|
|
|
|
result.push({
|
|
|
|
'data': [[_convert(xaxis[0], record[xaxis[0]]), record[yaxis[0]]]],
|
|
|
|
'label': _convert(xaxis[0], record[xaxis[0]], false)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else if ((! stacked) || (xaxis.length < 2)) {
|
|
|
|
var defs = [];
|
|
|
|
_.each(xaxis, function(x) {
|
2012-10-30 14:06:30 +00:00
|
|
|
defs.push(obj.call("read_group", [domain, yaxis.concat([x]), [x]], {context: context}).then(function(res) {
|
2012-10-23 14:58:58 +00:00
|
|
|
return [x, res];
|
|
|
|
}));
|
|
|
|
});
|
2012-10-30 14:06:30 +00:00
|
|
|
return $.when.apply($, defs).then(function() {
|
2012-10-23 14:58:58 +00:00
|
|
|
_.each(_.toArray(arguments), function(res) {
|
|
|
|
var x = res[0];
|
|
|
|
res = res[1];
|
|
|
|
result.push({
|
|
|
|
'data': _.map(res, function(record) {
|
|
|
|
return _orientation(_convert(x, record[x]), record[yaxis[0]] || 0);
|
|
|
|
}),
|
|
|
|
'label': fields[x]['string']
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
xaxis.reverse();
|
2012-10-30 14:06:30 +00:00
|
|
|
return obj.call("read_group", [domain, yaxis.concat(xaxis.slice(0, 1)), xaxis.slice(0, 1)], {context: context}).then(function(axis) {
|
2012-10-23 14:58:58 +00:00
|
|
|
var defs = [];
|
|
|
|
_.each(axis, function(x) {
|
|
|
|
var key = x[xaxis[0]]
|
2012-10-23 15:16:15 +00:00
|
|
|
defs.push(obj.call("read_group", [new instance.web.CompoundDomain(domain, [[xaxis[0], '=' ,_convert_key(xaxis[0], key)]]),
|
2012-10-30 14:06:30 +00:00
|
|
|
yaxis.concat(xaxis.slice(1, 2)), xaxis.slice(1, 2)], {context: context}).then(function(res) {
|
2012-10-23 14:58:58 +00:00
|
|
|
return [x, key, res];
|
|
|
|
}));
|
|
|
|
});
|
2012-10-30 14:06:30 +00:00
|
|
|
return $.when.apply($, defs).then(function() {
|
2012-10-23 15:17:40 +00:00
|
|
|
_.each(_.toArray(arguments), function(res) {
|
|
|
|
var x = res[0];
|
|
|
|
var key = res[1];
|
|
|
|
res = res[2];
|
|
|
|
result.push({
|
|
|
|
'data': _.map(res, function(record) {
|
|
|
|
return _orientation(_convert(xaxis[1], record[xaxis[1]]), record[yaxis[0]] || 0);
|
|
|
|
}),
|
|
|
|
'label': _convert(xaxis[0], key, false)
|
|
|
|
})
|
|
|
|
});
|
2012-10-23 14:58:58 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
2012-10-30 14:06:30 +00:00
|
|
|
}).then(function() {
|
2012-10-23 14:58:58 +00:00
|
|
|
var res = {
|
|
|
|
'data': result,
|
|
|
|
'ticks': _.map(ticks, function(el, key) { return [el, key] })
|
|
|
|
};
|
|
|
|
return res;
|
2012-06-07 14:17:12 +00:00
|
|
|
});
|
|
|
|
},
|
2012-05-07 21:06:43 +00:00
|
|
|
|
2012-05-07 09:40:59 +00:00
|
|
|
// Render the graph and update menu styles
|
|
|
|
graph_render: function (options) {
|
2012-06-07 14:17:12 +00:00
|
|
|
options = options || {};
|
|
|
|
_.extend(this, options.data);
|
2012-05-07 22:32:57 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
return this.graph_get_data()
|
2012-10-30 14:06:30 +00:00
|
|
|
.done(this.proxy('graph_render_all'));
|
2012-05-07 21:06:43 +00:00
|
|
|
},
|
2012-05-07 09:40:59 +00:00
|
|
|
|
2012-05-07 23:42:18 +00:00
|
|
|
graph_render_all: function (data) {
|
2012-06-07 14:17:12 +00:00
|
|
|
var i;
|
|
|
|
if (this.mode=='area') {
|
|
|
|
for (i=0; i<data.data.length; i++) {
|
|
|
|
data.data[i].lines = {fill: true}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.graph) {
|
2012-05-07 13:38:21 +00:00
|
|
|
this.graph.destroy();
|
2012-06-07 14:17:12 +00:00
|
|
|
}
|
2011-06-17 11:52:26 +00:00
|
|
|
|
2012-05-07 09:40:59 +00:00
|
|
|
// Render the graph
|
2012-08-24 18:27:07 +00:00
|
|
|
this.$el.find(".graph_header_legend").children().remove();
|
2012-06-07 14:17:12 +00:00
|
|
|
this.graph = this.make_graph(this.mode, this.container, data);
|
2012-05-07 09:40:59 +00:00
|
|
|
|
|
|
|
// Update styles of menus
|
|
|
|
|
2012-08-24 18:27:07 +00:00
|
|
|
this.$el.find("a").removeClass("active");
|
2012-05-07 09:40:59 +00:00
|
|
|
|
2012-08-24 18:27:07 +00:00
|
|
|
var $active = this.$el.find('a[data-mode=' + this.mode + ']');
|
2012-06-07 15:46:45 +00:00
|
|
|
if ($active.length > 1) {
|
|
|
|
$active = $active.filter('[data-stacked=' + this.stacked + ']');
|
2012-06-07 14:17:12 +00:00
|
|
|
}
|
2012-06-07 15:46:45 +00:00
|
|
|
$active = $active.add(
|
2012-08-24 18:27:07 +00:00
|
|
|
this.$el.find('a:not([data-mode])[data-legend=' + this.legend + ']'));
|
2012-06-07 15:46:45 +00:00
|
|
|
|
|
|
|
$active.addClass('active');
|
2012-05-07 09:40:59 +00:00
|
|
|
|
2012-06-07 14:17:12 +00:00
|
|
|
if (this.spreadsheet) {
|
2012-08-24 18:27:07 +00:00
|
|
|
this.$el.find("#graph_show_data").addClass("active");
|
2012-06-07 14:17:12 +00:00
|
|
|
}
|
2012-05-07 13:38:21 +00:00
|
|
|
return this.graph;
|
2011-05-06 12:41:08 +00:00
|
|
|
},
|
2012-05-07 09:40:59 +00:00
|
|
|
|
|
|
|
// render the graph using the domain, context and group_by
|
|
|
|
// calls the 'graph_data_get' python controller to process all data
|
2012-05-07 15:55:01 +00:00
|
|
|
// TODO: check is group_by should better be in the context
|
2011-09-29 11:48:15 +00:00
|
|
|
do_search: function(domain, context, group_by) {
|
2012-05-07 15:55:01 +00:00
|
|
|
this.domain = domain;
|
|
|
|
this.context = context;
|
|
|
|
this.group_by = group_by;
|
|
|
|
|
|
|
|
this.graph_render();
|
2012-01-03 16:06:50 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
do_show: function() {
|
|
|
|
this.do_push_state({});
|
|
|
|
return this._super();
|
2012-05-07 08:19:08 +00:00
|
|
|
},
|
2011-04-15 06:42:41 +00:00
|
|
|
});
|
|
|
|
};
|