bzr revid: nicolas.vanhoren@openerp.com-
20120214152031-br1lq6zqx6ycdj7p
},
size: function () {
return this.ids.length;
- }
+ },
+ alter_ids: function(n_ids) {
+ this.ids = n_ids;
+ },
});
openerp.web.DataSetStatic = openerp.web.DataSet.extend({
init: function(parent, model, context, ids) {
}
}
return this._super(method, args, callback, error_callback);
- }
+ },
+ alter_ids: function(n_ids) {
+ this._super(n_ids);
+ this.on_change();
+ },
});
openerp.web.BufferedDataSet.virtual_id_regex = /^one2many_v_id_.*$/;
} else {
this.datarecord.id = r.result;
if (!prepend_on_create) {
- this.dataset.ids.push(this.datarecord.id);
+ this.dataset.alter_ids(this.dataset.ids.concat([this.datarecord.id]));
this.dataset.index = this.dataset.ids.length - 1;
} else {
- this.dataset.ids.unshift(this.datarecord.id);
+ this.dataset.alter_ids([this.datarecord.id].concat(this.dataset.ids));
this.dataset.index = 0;
}
this.do_update_pager();