diff options
| author | Vincent Schippefilt <vsc@odoo.com> | 2018-05-15 14:55:00 +0200 |
|---|---|---|
| committer | qdp-odoo <qdp@odoo.com> | 2018-05-15 14:55:00 +0200 |
| commit | 09125f78c35c1a2bc1d1bb6abc3698759e2df01b (patch) | |
| tree | b78d2eac1c8fd0f071b0bf4b7490fa3759ef3ee1 /addons/web/static/src/js | |
| parent | 32c6d129ca94500d1a7de6fbece74e54c78bca9c (diff) | |
[IMP] web: allow usage of computed unstored fields in pivot views
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_view.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/pivot/pivot_view.js b/addons/web/static/src/js/views/pivot/pivot_view.js index e0b232b6310..251fa10200d 100644 --- a/addons/web/static/src/js/views/pivot/pivot_view.js +++ b/addons/web/static/src/js/views/pivot/pivot_view.js @@ -33,6 +33,7 @@ var PivotView = AbstractView.extend({ * @param {Object} params */ init: function (viewInfo, params) { + var self = this; this._super.apply(this, arguments); var self = this; @@ -71,8 +72,9 @@ var PivotView = AbstractView.extend({ // the measure should be allowed. However, be careful if you define // a measure in your pivot view: non stored functional fields will // probably not work (their aggregate will always be 0). - if (field.type === 'measure' && !(field.name in measures)) { - measures[field.name] = field; + + if (field.attrs.type === 'measure' && !(field.attrs.name in measures)) { + measures[field.attrs.name] = self.fields[field.attrs.name]; } if (field.attrs.type === 'measure' || 'operator' in field.attrs) { activeMeasures.push(name); @@ -100,6 +102,7 @@ var PivotView = AbstractView.extend({ this.controllerParams.groupableFields = groupableFields; // retrieve form and list view ids from the action to open those views // when a data cell of the pivot view is clicked + this.controllerParams.views = [ _findView(params.action && params.action.views, 'list'), _findView(params.action && params.action.views, 'form'), |
