diff options
| author | Aaron Bohy <aab@odoo.com> | 2018-01-22 10:56:32 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-01-22 20:00:53 +0100 |
| commit | cf6697dfbd00a458cb56caf57a0d359310690f55 (patch) | |
| tree | a367a5057e710543e118ec7804a548fe3014e1a1 /addons/web/static/src/js | |
| parent | e8fa9428e86843bacad5456fa44b1fd78a3d2ce6 (diff) | |
[FIX] web: ActionManager: honor action's groupBy
Before this rev., the group_by specified in the action context was
completely overridden by the group_by specified in the search view,
even if it was []. In other words, it was completely ignored.
Moreover, it was only took into account (before being overridden)
at the first load of a view, not at reload.
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/chrome/action_manager_act_window.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/addons/web/static/src/js/chrome/action_manager_act_window.js b/addons/web/static/src/js/chrome/action_manager_act_window.js index 04322237d7a..1410063dcca 100644 --- a/addons/web/static/src/js/chrome/action_manager_act_window.js +++ b/addons/web/static/src/js/chrome/action_manager_act_window.js @@ -302,10 +302,6 @@ ActionManager.include({ * @returns {Object} */ _generateActionEnv: function (action, options) { - var actionGroupBy = action.context.group_by || []; - if (typeof actionGroupBy === 'string') { - actionGroupBy = [actionGroupBy]; - } var resID = options.resID || action.res_id; return { modelName: action.res_model, @@ -313,7 +309,7 @@ ActionManager.include({ currentId: resID || undefined, domain: [], context: action.context || {}, - groupBy: actionGroupBy, + groupBy: [], }; }, /** @@ -444,10 +440,11 @@ ActionManager.include({ throw new Error(_.str.sprintf(_t("Failed to evaluate search criterions")+": \n%s", JSON.stringify(results.error))); } + var groupBy = results.group_by.length ? results.group_by : (action.context.group_by || []); return { context: results.context, domain: results.domain, - groupBy: results.group_by, + groupBy: (typeof groupBy === 'string') ? [groupBy] : groupBy, }; }, /** |
