[fix] complex bug in BufferedDataSet
lp bug: https://launchpad.net/bugs/925345 fixed bzr revid: nicolas.vanhoren@openerp.com-20120214161558-k634bkwbwq0vk58p
This commit is contained in:
parent
471d403d81
commit
cf6b9b6e3e
|
@ -764,7 +764,7 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({
|
||||||
self.cache.push({id: id, values: record});
|
self.cache.push({id: id, values: record});
|
||||||
} else {
|
} else {
|
||||||
// I assume cache value is prioritary
|
// I assume cache value is prioritary
|
||||||
_.defaults(cached.values, record);
|
cached.values = _.defaults(_.clone(cached.values), record);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return_records();
|
return_records();
|
||||||
|
|
|
@ -2394,13 +2394,13 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
|
||||||
obj['id'] = _.uniqueId(self.dataset.virtual_id_prefix);
|
obj['id'] = _.uniqueId(self.dataset.virtual_id_prefix);
|
||||||
obj.defaults = {};
|
obj.defaults = {};
|
||||||
self.dataset.to_create.push(obj);
|
self.dataset.to_create.push(obj);
|
||||||
self.dataset.cache.push(_.clone(obj));
|
self.dataset.cache.push(_.extend(_.clone(obj), {values: _.clone(command[2])}));
|
||||||
ids.push(obj.id);
|
ids.push(obj.id);
|
||||||
return;
|
return;
|
||||||
case commands.UPDATE:
|
case commands.UPDATE:
|
||||||
obj['id'] = command[1];
|
obj['id'] = command[1];
|
||||||
self.dataset.to_write.push(obj);
|
self.dataset.to_write.push(obj);
|
||||||
self.dataset.cache.push(_.clone(obj));
|
self.dataset.cache.push(_.extend(_.clone(obj), {values: _.clone(command[2])}));
|
||||||
ids.push(obj.id);
|
ids.push(obj.id);
|
||||||
return;
|
return;
|
||||||
case commands.DELETE:
|
case commands.DELETE:
|
||||||
|
|
Loading…
Reference in New Issue