[FIX] web: need to initialize values into the cache

This commit is contained in:
Christophe Matthieu
2015-08-17 16:17:22 +02:00
parent 7a6e94edd8
commit 03e982b93f
+4 -1
View File
@@ -745,7 +745,7 @@ var BufferedDataSet = DataSetStatic.extend({
// this.from_readonly.
var cached = _.detect(this.cache, function(x) {return x.id === id;});
if (!cached) {
this.cache.push(cached = {id: id});
this.cache.push(cached = {id: id, values: {}});
}
var record = _.detect(this.from_read, function(x) {return x.id === id;});
if (record) {
@@ -831,6 +831,9 @@ var BufferedDataSet = DataSetStatic.extend({
}
var record_from_read = _.detect(self.from_read, function(x) {return x.id === id;});
if (!record_from_read) {
record_from_read = {values: {}};
}
_.each(data, function (v, k) {
if (!_.isEqual(v, cached.values[k])) {
dirty = true;