[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
This commit is contained in:
Nicolas Martinelli
2017-12-19 11:18:12 +01:00
committed by Nicolas Martinelli
parent f65f065901
commit ad8e1118c1
+2 -1
View File
@@ -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();
},