diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-12-18 15:42:02 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-12-18 15:49:38 +0100 |
| commit | c9acaa428cba36bbee5b9e97eca23673cacb0b15 (patch) | |
| tree | a18f6eaaf9f02983fa2c2a8abc2029b9d80e5129 /addons/web/static/src | |
| parent | dc25eac8d46fe37f9cd956ab5dd831e1a1b22d88 (diff) | |
[FIX] web: view pivot, start must wait load_fields
in `view_pivot.js`,
the method `view_loading` must wait the `self.fields` variable
to be defined before working properly.
This `self.fields` variable is filled in the `prepare_fields` method,
which is called in the `start` method, through a deferred named
`load_fields`.
`view_loading` is called in `start`, in `views.js`.
Therefore, in the overriden method `start` of `view_pivot.js`,
the call to `_super`, calling the `start` of `views.js`, must wait for
the `load_fields` deferred to be resolved.
Otherwise, the `self.fields` variable, mentioned above, won't be
filled in time.
opw-660153
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/view_pivot.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/view_pivot.js b/addons/web/static/src/js/view_pivot.js index b9e3f07cb00..6e09c8ed098 100644 --- a/addons/web/static/src/js/view_pivot.js +++ b/addons/web/static/src/js/view_pivot.js @@ -65,8 +65,9 @@ instance.web.PivotView = instance.web.View.extend({ var load_fields = this.model.call('fields_get', [], {context: this.dataset.get_context()}) .then(this.prepare_fields.bind(this)); + var _super = this._super.bind(this); - return $.when(this._super(), load_fields).then(this.render_buttons.bind(this)).then(function(){ + return load_fields.then(function(){return _super();}).then(this.render_buttons.bind(this)).then(function(){ if (self.$sidebar) { return openerp.session.rpc('/web/pivot/check_xlwt').then(function (result) { if (result) { |
