summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/graph_widget.js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2014-01-22 14:34:52 +0100
committerGery Debongnie <ged@openerp.com>2014-01-22 14:34:52 +0100
commita3bb723379d5b9c9302658925c076ce4a341d76c (patch)
tree61485d43a88fd05ecb4bc715b6097a7284d765fd /addons/web_graph/static/src/js/graph_widget.js
parentd0806ed3f7730e42aa4666c6122139121a9d7391 (diff)
[IMP] changes the backend code of graph view to use the new functionality of read_group (use 'field_name:interval' in readgroup instead of context (addon web_graph)
bzr revid: ged@openerp.com-20140122133452-wy3hrsrokhnwc3ru
Diffstat (limited to 'addons/web_graph/static/src/js/graph_widget.js')
-rw-r--r--addons/web_graph/static/src/js/graph_widget.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js
index 0b78468b0b4..7b4d96ce304 100644
--- a/addons/web_graph/static/src/js/graph_widget.js
+++ b/addons/web_graph/static/src/js/graph_widget.js
@@ -177,13 +177,20 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
},
create_field_value: function (f) {
- var important_field = _.findWhere(this.important_fields, {field:f}),
- string = important_field ? important_field.string : this.fields[f].string,
- result = {field: f, string: string, type: this.fields[f].type };
+ var field = f.field || ((_.contains(f, ':')) ? f.split(':')[0] : f),
+ important_field = _.findWhere(this.important_fields, {field:field}),
+ string = important_field ? important_field.string : this.fields[field].string,
+ result = {field: field, string: string, type: this.fields[field].type };
if (important_field) {
result.filter = important_field.filter;
}
+ if (f.interval) {
+ result.interval = f.interval;
+ }
+ if (_.contains(f, ':')) {
+ result.interval = f.split(':')[1];
+ }
return result;
},