summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/data.js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2014-04-08 11:08:52 +0200
committerGery Debongnie <ged@openerp.com>2014-04-08 11:08:52 +0200
commit53cca3a04652419fea1c7377acfe62eae1af8a88 (patch)
tree680a9ba3d9ce7c27916cdfd7548b1b4c43ae9dd1 /addons/web/static/src/js/data.js
parent4d797222279e361bfe6db0fe45f3ff503b87c717 (diff)
parentf1d3f2a0c42f1de5970b5f897c4e5b279d1ee23b (diff)
[MERGE] merge from trunk
bzr revid: ged@openerp.com-20140407080642-b51z9j9cryb72tpc bzr revid: ged@openerp.com-20140408090852-xmfi9nwd2lzsfbza
Diffstat (limited to 'addons/web/static/src/js/data.js')
-rw-r--r--addons/web/static/src/js/data.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js
index 9d11dbcf2a8..6819634655d 100644
--- a/addons/web/static/src/js/data.js
+++ b/addons/web/static/src/js/data.js
@@ -480,9 +480,17 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin,
return $.Deferred().resolve([]);
options = options || {};
- return this._model.call('read',
- [ids, fields || false],
- {context: this.get_context(options.context)})
+ var method = 'read';
+ var ids_arg = ids;
+ var context = this.get_context(options.context);
+ if (options.check_access_rule === true){
+ method = 'search_read';
+ ids_arg = [['id', 'in', ids]];
+ context = new instance.web.CompoundContext(context, {active_test: false});
+ }
+ return this._model.call(method,
+ [ids_arg, fields || false],
+ {context: context})
.then(function (records) {
if (records.length <= 1) { return records; }
var indexes = {};