From 03e982b93ff87f7fbb291152b1fab0b555a9dd87 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 17 Aug 2015 16:17:08 +0200 Subject: [PATCH] [FIX] web: need to initialize values into the cache --- addons/web/static/src/js/framework/data.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/framework/data.js b/addons/web/static/src/js/framework/data.js index d44bcb79f15..c0c297fee09 100644 --- a/addons/web/static/src/js/framework/data.js +++ b/addons/web/static/src/js/framework/data.js @@ -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;