diff options
| author | Géry Debongnie <ged@odoo.com> | 2018-01-05 13:09:43 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-01-26 19:26:03 +0100 |
| commit | cb339842d4d8b19f3870127c00a6868af2e95004 (patch) | |
| tree | 5a738a06894b0318e4398e737ebadf1157b8c073 /addons/web/static/src/js/views/graph/graph_view.js | |
| parent | 12fa4e565a734bd4e0be7cb83ff320f32cb4f33e (diff) | |
[REF] web,*: move fvg processing from DataManager to Views
*: mail, web_diagram
Diffstat (limited to 'addons/web/static/src/js/views/graph/graph_view.js')
| -rw-r--r-- | addons/web/static/src/js/views/graph/graph_view.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_view.js b/addons/web/static/src/js/views/graph/graph_view.js index 44e1f74e8da..feb151b02e7 100644 --- a/addons/web/static/src/js/views/graph/graph_view.js +++ b/addons/web/static/src/js/views/graph/graph_view.js @@ -36,13 +36,13 @@ var GraphView = AbstractView.extend({ /** * @override */ - init: function (viewInfo) { + init: function () { this._super.apply(this, arguments); var measure; var groupBys = []; - viewInfo.fields = _.defaults({__count__: {string: _t("Count"), type: "integer"}}, viewInfo.fields); - viewInfo.arch.children.forEach(function (field) { + this.fields.__count__ = {string: _t("Count"), type: "integer"}; + this.arch.children.forEach(function (field) { var name = field.attrs.name; if (field.attrs.interval) { name += ':' + field.attrs.interval; @@ -55,7 +55,7 @@ var GraphView = AbstractView.extend({ }); var measures = {__count__: {string: _t("Count"), type: "integer"}}; - _.each(viewInfo.fields, function (field, name) { + _.each(this.fields, function (field, name) { if (name !== 'id' && field.store === true) { if (field.type === 'integer' || field.type === 'float' || field.type === 'monetary') { measures[name] = field; @@ -64,12 +64,12 @@ var GraphView = AbstractView.extend({ }); this.controllerParams.measures = measures; - this.rendererParams.stacked = viewInfo.arch.attrs.stacked !== "False"; + this.rendererParams.stacked = this.arch.attrs.stacked !== "False"; - this.loadParams.mode = viewInfo.arch.attrs.type || 'bar'; + this.loadParams.mode = this.arch.attrs.type || 'bar'; this.loadParams.measure = measure || '__count__'; this.loadParams.groupBys = groupBys || []; - this.loadParams.fields = viewInfo.fields; + this.loadParams.fields = this.fields; }, }); |
