From f652402dd786eff52f7a34a0ca2bf48c3b9c8331 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 27 Mar 2014 12:24:56 +0100 Subject: [FIX] web: read_ids of data.js use method search_read if check_access_rule option is true. This fix is related to revision 3985 revid:dle@openerp.com-20140326142040-pls0dk2kd03z55ro, which did not worked for buffered dataset (virtual one2many line in view form search_read is used instead of read to not return records for which we lose the access rights bzr revid: dle@openerp.com-20140327112456-iyceuf9dnn07hwke --- addons/web/static/src/js/data.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src/js/data.js') diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 517afa7f5c2..b31de507be4 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.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 = {}; -- cgit v1.2.3