diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2015-09-09 09:04:45 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2015-09-09 10:36:07 +0200 |
| commit | 655b13b0933c83eeda45a6da08f8fecccf3f077d (patch) | |
| tree | 923d20274288a933d5c940286fda53692f0fcf27 /addons/web/static/src/js/views | |
| parent | b99ef3b125af374c4055908a56563d4da036be65 (diff) | |
[FIX] web: m2m wait deferred to use fields
Diffstat (limited to 'addons/web/static/src/js/views')
| -rw-r--r-- | addons/web/static/src/js/views/form_relational_widgets.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js index e4f48e398b0..9b247d529fc 100644 --- a/addons/web/static/src/js/views/form_relational_widgets.js +++ b/addons/web/static/src/js/views/form_relational_widgets.js @@ -1371,8 +1371,10 @@ var FieldMany2ManyTags = AbstractManyField.extend(common.CompletionFieldMixin, c var self = this; // We need to know if the field 'color' exists on the model - this.dataset.call('fields_get', []).then(function(fields) { - self.fields = fields; + this.mutex.exec(function(){ + return self.dataset.call('fields_get', []).then(function(fields) { + self.fields = fields; + }); }); }, initialize_content: function() { @@ -1407,8 +1409,11 @@ var FieldMany2ManyTags = AbstractManyField.extend(common.CompletionFieldMixin, c } }, get_render_data: function(ids){ - var fields = this.fields.color ? ['name', 'color'] : ['name']; - return this.dataset.read_ids(ids, fields); + var self = this; + return this.mutex.exec(function(){ + var fields = self.fields.color ? ['name', 'color'] : ['name']; + return self.dataset.read_ids(ids, fields); + }); }, render_tag: function(data) { this.$('.badge').remove(); |
