diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-02-14 17:15:58 +0100 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-02-14 17:15:58 +0100 |
| commit | cf6b9b6e3e9f0778fe57c8d2fd53f7b9d742290d (patch) | |
| tree | 541bc163c68ee1e0273ff8ca9a8f9d6319855152 /addons/web/static/src | |
| parent | 471d403d818c44cc08300b9a3fb77f4f71e894ef (diff) | |
[fix] complex bug in BufferedDataSet
lp bug: https://launchpad.net/bugs/925345 fixed
bzr revid: nicolas.vanhoren@openerp.com-20120214161558-k634bkwbwq0vk58p
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/data.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 38119c63d3a..636ad575f99 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -764,7 +764,7 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({ self.cache.push({id: id, values: record}); } else { // I assume cache value is prioritary - _.defaults(cached.values, record); + cached.values = _.defaults(_.clone(cached.values), record); } }); return_records(); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index ff0ef5e5fea..8c9b99a02a2 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2394,13 +2394,13 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ obj['id'] = _.uniqueId(self.dataset.virtual_id_prefix); obj.defaults = {}; 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); return; case commands.UPDATE: obj['id'] = command[1]; 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); return; case commands.DELETE: |
