diff options
| author | Gery Debongnie <ged@openerp.com> | 2014-01-24 09:42:22 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2014-01-24 09:42:22 +0100 |
| commit | 29d08d9a6bc31b5ddaccaca78c97e9f093725069 (patch) | |
| tree | f6eed6b6f3f91c673aeccc286d9a8ee4a34a4e0a /addons/web_graph/static/src | |
| parent | 59b75a0176143da2756e8658ea853a64b23e7e84 (diff) | |
[IMP] graph_view now properly honors the 'interval' attribute of field names in the xml description (addon web_graph)
bzr revid: ged@openerp.com-20140124084222-dq1gpg1tg8rinozx
Diffstat (limited to 'addons/web_graph/static/src')
| -rw-r--r-- | addons/web_graph/static/src/js/graph_view.js | 14 | ||||
| -rw-r--r-- | addons/web_graph/static/src/js/graph_widget.js | 1 |
2 files changed, 10 insertions, 5 deletions
diff --git a/addons/web_graph/static/src/js/graph_view.js b/addons/web_graph/static/src/js/graph_view.js index 39634ff103a..1122089f060 100644 --- a/addons/web_graph/static/src/js/graph_view.js +++ b/addons/web_graph/static/src/js/graph_view.js @@ -47,23 +47,27 @@ instance.web_graph.GraphView = instance.web.View.extend({ }; _.each(arch.children, function (field) { + var field_name = field.attrs.name; + if (_.has(field.attrs, 'interval')) { + field_name = field.attrs.name + ':' + field.attrs.interval; + } if (_.has(field.attrs, 'type')) { switch (field.attrs.type) { case 'row': - self.widget_config.row_groupby.push(field.attrs.name); + self.widget_config.row_groupby.push(field_name); break; case 'col': - self.widget_config.col_groupby.push(field.attrs.name); + self.widget_config.col_groupby.push(field_name); break; case 'measure': - self.widget_config.measures.push(field.attrs.name); + self.widget_config.measures.push(field_name); break; } } else { // old style, kept for backward compatibility if ('operator' in field.attrs) { - self.widget_config.measures.push(field.attrs.name); + self.widget_config.measures.push(field_name); } else { - self.widget_config.row_groupby.push(field.attrs.name); + self.widget_config.row_groupby.push(field_name); } } }); diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index 64b163e883d..d9fd73924ee 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -281,6 +281,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ if (!this.important_fields.length) { return; } + var fields = _.map(this.important_fields, function (field) { return {id: field.field, value: field.string, type:self.fields[field.field].type}; }); |
