[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:
Christophe Simonis 2013-11-15 12:23:11 +01:00
commit 36b3ea41d8
2 changed files with 6 additions and 7 deletions

View File

@ -3041,7 +3041,7 @@ instance.web.form.CompletionFieldMixin = {
values.push({
label: _t("Search More..."),
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);
});
},

View File

@ -1474,14 +1474,13 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
var view = this.view,
limit = view.limit(),
d = new $.Deferred(),
page = this.datagroup.openable ? this.page : view.page;
var fields = _.pluck(_.select(this.columns, function(x) {return x.tag == "field";}), 'name');
var options = { offset: page * limit, limit: limit, context: {bin_size: true} };
//TODO xmo: investigate why we need to put the setTimeout
$.async_when().done(function() {
dataset.read_slice(fields, options).done(function (records) {
return $.async_when().then(function() {
return dataset.read_slice(fields, options).then(function (records) {
// FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently
if (self.records.length) {
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});
list.render();
d.resolve(list);
if (_.isEmpty(records)) {
view.no_result();
}
return list;
});
});
return d.promise();
},
setup_resequence_rows: function (list, dataset) {
// 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));
if (post_render) { post_render(); }
}, function (dataset) {
self.render_dataset(dataset).done(function (list) {
self.render_dataset(dataset).then(function (list) {
self.children[null] = list;
self.elements =
[list.$current.replaceAll($el)[0]];
self.setup_resequence_rows(list, dataset);
}).always(function() {
if (post_render) { post_render(); }
});
});