[FIX] insertion at end: 'null' index should be same as 'undefined' for 'at' kwarg to Collection.add

bzr revid: xmo@openerp.com-20110822105656-f0x1iweoxbh8hcgu
This commit is contained in:
Xavier Morel
2011-08-22 12:56:56 +02:00
parent 63d2dcce40
commit 6ccc41fe2b
+1 -1
View File
@@ -1315,7 +1315,7 @@ var Collection = openerp.base.Class.extend(/** @lends Collection# */{
var instance = (records[i] instanceof Record) ? records[i] : new Record(records[i]);
instance.bind(null, this._onRecordEvent);
this._byId[instance.get('id')] = instance;
if (options.at === undefined) {
if (options.at == undefined) {
this.records.push(instance);
if (!options.silent) {
this.trigger('add', this, instance, this.records.length-1);