From b3391cd7fef94c4e82b4330db37213c08740d055 Mon Sep 17 00:00:00 2001 From: "Mohammed Shekha (OpenERP)" Date: Tue, 3 Dec 2013 18:08:56 +0530 Subject: [PATCH] [FIX]Web: Fixed the issue of immediate update of many2one field when many2one object name has been changed from follow button popup, reloaded the record from database forcefull to update dataaset, do not call form-blur when follow button is clicked, also do not evict record when record is still not created. bzr revid: msh@openerp.com-20131203123856-gce4li1igo9k1mak --- addons/web/static/src/js/data.js | 9 +++++++++ addons/web/static/src/js/view_form.js | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index d497cf25343..e1290deac02 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -920,6 +920,15 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ * @param {Object} id record to remove from the BDS's cache */ evict_record: function (id) { + // Don't evict records which haven't yet been saved: there is no more + // recent data on the server (and there potentially isn't any data), + // and this breaks the assumptions of other methods (that the data + // for new and altered records is both in the cache and in the to_write + // or to_create collection) + if (_(this.to_create.concat(this.to_write)).find(function (record) { + return record.id === id; })) { + return; + } for(var i=0, len=this.cache.length; i