summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/data.js
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2014-04-08 10:37:33 +0200
committerThibault Delavallée <tde@openerp.com>2014-04-08 10:37:33 +0200
commita74eb749ae38784f370a9eeb073c3bbf09b35bbd (patch)
tree3c83c289f1cb493d887ee8b647616465885fb3c9 /addons/web/static/src/js/data.js
parent423f81bf5cf4dd9e949fcabbd2babe4fe3187676 (diff)
parentf1d3f2a0c42f1de5970b5f897c4e5b279d1ee23b (diff)
[MERGE] Sync with trunk
bzr revid: tde@openerp.com-20140401100513-e4iglorrxnj0ne8j bzr revid: tde@openerp.com-20140403122017-zl668mpi0w5gwps0 bzr revid: tde@openerp.com-20140408083733-8plf5daah4c8yxxx
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 517afa7f5c2..73f244bc6a3 100644
--- a/addons/web/static/src/js/data.js
+++ b/addons/web/static/src/js/data.js
@@ -457,9 +457,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 = {};