From ad8e1118c1a18c22555abecccfb8ee0eee387e5e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 14 Dec 2017 11:54:18 +0100 Subject: [PATCH] [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 --- addons/web/static/src/js/action_manager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); },