diff options
| author | Julien Mougenot <jum@odoo.com> | 2020-03-17 08:26:23 +0000 |
|---|---|---|
| committer | Julien Mougenot <jum@odoo.com> | 2020-03-17 08:26:25 +0000 |
| commit | d678d516ef74de983dcaed8c0ed8cc39a0af0669 (patch) | |
| tree | 5d4df5cf52c09f09288b3ab831757f153b6db837 /addons/web/static/src/js/components | |
| parent | 7cdf8c25a63753f8370b15e0307b8e57d9db9b7c (diff) | |
[FIX] web: action menus default select_all
Before this commit, the context sent by an action performed by the action menu
could hold an 'undefined' select_all key, which would cause the context evaluation
to crash.
Now, the select_all key is defaulted to 'false' and does not crash in actions that
do not provide it.
closes odoo/odoo#47745
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/components')
| -rw-r--r-- | addons/web/static/src/js/components/action_menus.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/addons/web/static/src/js/components/action_menus.js b/addons/web/static/src/js/components/action_menus.js index d94e162ca44..69a10423373 100644 --- a/addons/web/static/src/js/components/action_menus.js +++ b/addons/web/static/src/js/components/action_menus.js @@ -99,19 +99,16 @@ odoo.define('web.ActionMenus', function (require) { active_id: this.props.activeIds[0], active_ids: this.props.activeIds, active_model: this.env.action.res_model, - select_all: this.props.selectAll, + select_all: this.props.selectAll || false, }; if (this.props.domain) { activeIdsContext.active_domain = this.props.domain; } - const context = pyUtils.eval('context', new Context(this.props.context, activeIdsContext)); + const context = new Context(this.props.context, activeIdsContext).eval(); const result = await this.rpc({ route: '/web/action/load', - params: { - action_id: action.id, - context: context, - }, + params: { action_id: action.id, context }, }); result.context = new Context(result.context || {}, activeIdsContext) .set_eval_context(context); |
