[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.
This commit is contained in:
Géry Debongnie
2016-03-21 17:05:07 +01:00
parent 95f8693a3d
commit e9c34b5e61
@@ -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 {
};
});