diff options
| author | Aaron Bohy <aab@odoo.com> | 2019-03-27 13:38:46 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2019-04-02 11:57:00 +0000 |
| commit | ca19b17fd3e09d2f4e53208542f4356d3a6ee25a (patch) | |
| tree | 63b092ff0681647cfeba79db64bca051ca45ed0c /addons/web/static/src/js/core | |
| parent | d0164d834bb18f37f15a129e911f7d8e1c54b7c3 (diff) | |
[IMP] web: fetch records alongside read_group
This rev. adds params to the 'web_read_group' method, allowing to
search_read records inside each groups in a single RPC, instead of
doing a 'web_read_group' RPC followed by n 'search_read' RPCs,
where n is the number of opened groups.
Part of task 1915702
Diffstat (limited to 'addons/web/static/src/js/core')
| -rw-r--r-- | addons/web/static/src/js/core/rpc.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/web/static/src/js/core/rpc.js b/addons/web/static/src/js/core/rpc.js index 802f7082cad..b09f7542b5c 100644 --- a/addons/web/static/src/js/core/rpc.js +++ b/addons/web/static/src/js/core/rpc.js @@ -68,6 +68,13 @@ return { orderBy = options.orderBy || params.orderBy || params.kwargs.orderby; params.kwargs.orderby = orderBy ? this._serializeSort(orderBy) : orderBy; params.kwargs.lazy = 'lazy' in options ? options.lazy : params.lazy; + + if (options.method === 'web_read_group') { + params.kwargs.expand = options.expand || params.expand || params.kwargs.expand; + params.kwargs.expand_limit = options.expand_limit || params.expand_limit || params.kwargs.expand_limit; + var expandOrderBy = options.expand_orderby || params.expand_orderby || params.kwargs.expand_orderby; + params.kwargs.expand_orderby = expandOrderBy ? this._serializeSort(expandOrderBy) : expandOrderBy; + } } if (options.method === 'search_read') { |
