[MERGE] forward port of branch saas-1 up to revid 3751 chs@openerp.com-20131115104909-3u3mu40g9xnler88
bzr revid: chs@openerp.com-20131115112311-mq197ugcdc38gjnw
This commit is contained in:
commit
36b3ea41d8
|
@ -3041,7 +3041,7 @@ instance.web.form.CompletionFieldMixin = {
|
||||||
values.push({
|
values.push({
|
||||||
label: _t("Search More..."),
|
label: _t("Search More..."),
|
||||||
action: function() {
|
action: function() {
|
||||||
dataset.name_search(search_val, self.build_domain(), 'ilike', false).done(function(data) {
|
dataset.name_search(search_val, self.build_domain(), 'ilike', 160).done(function(data) {
|
||||||
self._search_create_popup("search", data);
|
self._search_create_popup("search", data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -1474,14 +1474,13 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
|
||||||
|
|
||||||
var view = this.view,
|
var view = this.view,
|
||||||
limit = view.limit(),
|
limit = view.limit(),
|
||||||
d = new $.Deferred(),
|
|
||||||
page = this.datagroup.openable ? this.page : view.page;
|
page = this.datagroup.openable ? this.page : view.page;
|
||||||
|
|
||||||
var fields = _.pluck(_.select(this.columns, function(x) {return x.tag == "field";}), 'name');
|
var fields = _.pluck(_.select(this.columns, function(x) {return x.tag == "field";}), 'name');
|
||||||
var options = { offset: page * limit, limit: limit, context: {bin_size: true} };
|
var options = { offset: page * limit, limit: limit, context: {bin_size: true} };
|
||||||
//TODO xmo: investigate why we need to put the setTimeout
|
//TODO xmo: investigate why we need to put the setTimeout
|
||||||
$.async_when().done(function() {
|
return $.async_when().then(function() {
|
||||||
dataset.read_slice(fields, options).done(function (records) {
|
return dataset.read_slice(fields, options).then(function (records) {
|
||||||
// FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently
|
// FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently
|
||||||
if (self.records.length) {
|
if (self.records.length) {
|
||||||
self.records.reset(null, {silent: true});
|
self.records.reset(null, {silent: true});
|
||||||
|
@ -1513,13 +1512,12 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
|
||||||
|
|
||||||
self.records.add(records, {silent: true});
|
self.records.add(records, {silent: true});
|
||||||
list.render();
|
list.render();
|
||||||
d.resolve(list);
|
|
||||||
if (_.isEmpty(records)) {
|
if (_.isEmpty(records)) {
|
||||||
view.no_result();
|
view.no_result();
|
||||||
}
|
}
|
||||||
|
return list;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return d.promise();
|
|
||||||
},
|
},
|
||||||
setup_resequence_rows: function (list, dataset) {
|
setup_resequence_rows: function (list, dataset) {
|
||||||
// drag and drop enabled if list is not sorted and there is a
|
// drag and drop enabled if list is not sorted and there is a
|
||||||
|
@ -1600,11 +1598,12 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
|
||||||
self.render_groups(groups));
|
self.render_groups(groups));
|
||||||
if (post_render) { post_render(); }
|
if (post_render) { post_render(); }
|
||||||
}, function (dataset) {
|
}, function (dataset) {
|
||||||
self.render_dataset(dataset).done(function (list) {
|
self.render_dataset(dataset).then(function (list) {
|
||||||
self.children[null] = list;
|
self.children[null] = list;
|
||||||
self.elements =
|
self.elements =
|
||||||
[list.$current.replaceAll($el)[0]];
|
[list.$current.replaceAll($el)[0]];
|
||||||
self.setup_resequence_rows(list, dataset);
|
self.setup_resequence_rows(list, dataset);
|
||||||
|
}).always(function() {
|
||||||
if (post_render) { post_render(); }
|
if (post_render) { post_render(); }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue