[FIX] length management in dataset when items are removed from list view
bzr revid: xmo@openerp.com-20120306163841-4ko7el1t54xwguxr
This commit is contained in:
parent
8b13a99967
commit
d05add0c7d
|
@ -890,7 +890,10 @@ openerp.web.DataSetSearch = openerp.web.DataSet.extend(/** @lends openerp.web.D
|
|||
unlink: function(ids, callback, error_callback) {
|
||||
var self = this;
|
||||
return this._super(ids, function(result) {
|
||||
self.ids = _.without.apply(_, [self.ids].concat(ids));
|
||||
self.ids = _(self.ids).difference(ids);
|
||||
if (self._length) {
|
||||
self._length -= 1;
|
||||
}
|
||||
if (this.index !== null) {
|
||||
self.index = self.index <= self.ids.length - 1 ?
|
||||
self.index : (self.ids.length > 0 ? self.ids.length -1 : 0);
|
||||
|
|
|
@ -291,6 +291,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
|
|||
*/
|
||||
configure_pager: function (dataset) {
|
||||
this.dataset.ids = dataset.ids;
|
||||
this.dataset._length = dataset._length;
|
||||
|
||||
var limit = this.limit(),
|
||||
total = dataset.size(),
|
||||
|
|
Loading…
Reference in New Issue