From e9c34b5e61a3dc8e07d185cd513e9f8eee17c0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 21 Mar 2016 16:35:02 +0100 Subject: [PATCH] [FIX] web: fix issue with FieldMany2ManyTags the widget FieldMany2ManyTags does a rpc to fetch the fields (just to know if 'color' is in the model...). It was done in a mutex and used later in a mutex. This commit simply use the willStart method to make sure the data is available before rendering. --- .../static/src/js/views/form_relational_widgets.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 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 6cba3733ba1..61fd63d9e72 100644 --- a/addons/web/static/src/js/views/form_relational_widgets.js +++ b/addons/web/static/src/js/views/form_relational_widgets.js @@ -1395,13 +1395,11 @@ var FieldMany2ManyTags = AbstractManyField.extend(common.CompletionFieldMixin, c this._super(field_manager, node); common.CompletionFieldMixin.init.call(this); this.set({"value": []}); - + }, + willStart: function () { var self = this; - // We need to know if the field 'color' exists on the model - this.mutex.exec(function(){ - return self.dataset.call('fields_get', []).then(function(fields) { - self.fields = fields; - }); + return this.dataset.call('fields_get', []).then(function(fields) { + self.fields = fields; }); }, commit_value: function() { @@ -1732,4 +1730,3 @@ return { }; }); -