[FIX] removal of id-less records from list view

bzr revid: xmo@openerp.com-20120703091257-3dw0qs9aw125hrc7
This commit is contained in:
Xavier Morel 2012-07-03 11:12:57 +02:00
parent 29e65ff052
commit 4aa64c0033
1 changed files with 6 additions and 1 deletions

View File

@ -905,8 +905,13 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
this.record_callbacks = {
'remove': function (event, record) {
var $row = self.$current.children(
var $row;
if (!record.get('id')) {
$row = self.$current.children(':not([data-id])');
} else {
$row = self.$current.children(
'[data-id=' + record.get('id') + ']');
}
var index = $row.data('index');
$row.remove();
self.refresh_zebra(index);