diff options
| author | Mohammed Shekha (OpenERP) <msh@openerp.com> | 2013-12-03 18:08:56 +0530 |
|---|---|---|
| committer | Mohammed Shekha (OpenERP) <msh@openerp.com> | 2013-12-03 18:08:56 +0530 |
| commit | b3391cd7fef94c4e82b4330db37213c08740d055 (patch) | |
| tree | bba216001a68bcdbbafea93b1c29e5e846a4d53e /addons/web/static/src/js/data.js | |
| parent | a092227c6e037a5b05fa1ad74934952102f5588b (diff) | |
[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
Diffstat (limited to 'addons/web/static/src/js/data.js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 9 |
1 files changed, 9 insertions, 0 deletions
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<len; ++i) { var record = this.cache[i]; // if record we call the button upon is in the cache |
