[FIX] Fixed pager problem in form view.

bzr revid: nicolas.vanhoren@openerp.com-20110413074539-3j502n18f3xvn6ho
This commit is contained in:
niv-openerp 2011-04-13 09:45:39 +02:00
parent d3b56fdd3e
commit 8bfcf505a6
1 changed files with 4 additions and 2 deletions

View File

@ -140,11 +140,13 @@ openerp.base.ListView = openerp.base.Controller.extend(
return record.data.id.value;
}).value();
this.dataset.index = _.indexOf(this.dataset.ids, current_record_id);
if (this.dataset.index === -1) {
if (this.dataset.index < 0) {
this.dataset.index = 0;
}
this.dataset.count = this.dataset.ids.length;
// TODO: offset, length, count
// TODO: offset, length
var results = this.rows.length;
$table.find('.oe-pager-last').text(results);
$table.find('.oe-pager-total').text(results);