diff options
| author | Denis Ledoux <dle@openerp.com> | 2014-03-27 12:24:56 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@openerp.com> | 2014-03-27 12:24:56 +0100 |
| commit | f652402dd786eff52f7a34a0ca2bf48c3b9c8331 (patch) | |
| tree | 7935169b455a8916c9fbd8e99667e75986c5766e /addons/web/static/src/js/data.js | |
| parent | e80a179d021d88419555c7d371a2850ea37b92fa (diff) | |
[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
Diffstat (limited to 'addons/web/static/src/js/data.js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 14 |
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..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 = {}; |
