[FIX] start() synchronization in group search widget
Group did not propagate the result of start()ing its subwidgets to its caller (an other group or the searchview itself) => if it contained an async-starting widget (e.g. an m2o), the search view would not be able to wait for the async widget, and would consider itself 'intialized' before truly being so, leading to incorrect results in case of auto_search bzr revid: xmo@openerp.com-20110803110615-3ps3he9hza05h7q8
This commit is contained in:
@@ -140,7 +140,7 @@ openerp.base.SearchView = openerp.base.Widget.extend({
|
||||
var widget_starts = _(lines).chain().flatten().map(function (widget) {
|
||||
return widget.start();
|
||||
}).value();
|
||||
|
||||
|
||||
$.when.apply(null, widget_starts).then(function () {
|
||||
self.ready.resolve();
|
||||
});
|
||||
@@ -475,11 +475,11 @@ openerp.base.search.Group = openerp.base.search.Widget.extend({
|
||||
},
|
||||
start: function () {
|
||||
this._super();
|
||||
_(this.lines)
|
||||
.chain()
|
||||
.flatten()
|
||||
.each(function (widget) { widget.start(); });
|
||||
openerp.base.search.add_expand_listener(this.$element);
|
||||
var widget_starts = _(this.lines).chain().flatten()
|
||||
.map(function (widget) { return widget.start(); })
|
||||
.value();
|
||||
return $.when.apply(null, widget_starts);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -779,7 +779,7 @@ openerp.base.search.OneToManyField = openerp.base.search.CharField.extend({
|
||||
});
|
||||
openerp.base.search.ManyToOneField = openerp.base.search.CharField.extend({
|
||||
// TODO: @widget
|
||||
// TODO: .relation, .selection, .context, .domain
|
||||
// TODO: .selection, .context, .domain
|
||||
init: function (view_section, field, view) {
|
||||
this._super(view_section, field, view);
|
||||
var self = this;
|
||||
|
||||
Reference in New Issue
Block a user