[ADD] cache eviction for buffereddataset on records on which call_button has been invoked

lp bug: https://launchpad.net/bugs/885679 fixed

bzr revid: xmo@openerp.com-20111121163412-jyvpoa9smrk4qy2g
This commit is contained in:
Xavier Morel 2011-11-21 17:34:12 +01:00
parent 64ce2476c1
commit 89e5c72b6e
1 changed files with 13 additions and 0 deletions

View File

@ -730,6 +730,19 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({
return_records();
}
return completion.promise();
},
call_button: function (method, args, callback, error_callback) {
var id = args[0][0], index;
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
if (record.id === id) {
// evict it so it gets reloaded from server
this.cache.splice(i, 1);
break;
}
}
return this._super(method, args, callback, error_callback);
}
});
openerp.web.BufferedDataSet.virtual_id_regex = /^one2many_v_id_.*$/;