diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-12-14 11:54:18 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2017-12-19 11:18:12 +0100 |
| commit | ad8e1118c1a18c22555abecccfb8ee0eee387e5e (patch) | |
| tree | 435b9bfcb65ccbd226328fd5a9fb2bc7277057ca /addons/web/static/src | |
| parent | f65f0659011413cc5df04f031c31ef72489e28c6 (diff) | |
[FIX] web: action url never call on_close method
On a tree view:
- Add a button returning an `act_url` action; e.g.:
```
@api.multi
def open_google(self):
return {
'type': 'ir.actions.act_url',
'url': 'https://google.fr/',
'target': 'new',
}
```
- Click on a button
The action call works only once because the button is never re-enabled.
The button is actually enabled only at view rendering. Therefore, we
call `on_close` in order to reload the view.
opw-784587
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/action_manager.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js index 5eb5aaa9891..61978d7132d 100644 --- a/addons/web/static/src/js/action_manager.js +++ b/addons/web/static/src/js/action_manager.js @@ -790,7 +790,7 @@ var ActionManager = Widget.extend({ }); }); }, - ir_actions_act_url: function (action) { + ir_actions_act_url: function (action, options) { var url = action.url; if (session.debug && url && url.length && url[0] === '/') { url = $.param.querystring(url, 'debug'); @@ -800,6 +800,7 @@ var ActionManager = Widget.extend({ framework.redirect(url); } else { window.open(url, '_blank'); + options.on_close(); } return $.when(); }, |
