diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-01-02 13:56:49 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-01-02 13:56:49 +0100 |
| commit | ba2a83ddfac149715846113b07d361fa2c63a7f5 (patch) | |
| tree | a65e60dca9d3bcdfd6afb5f9efa58dd0c5931d63 /addons/web/static/src | |
| parent | b64d01f325a341a2541295c93ca5a4d916004b0a (diff) | |
| parent | e336dc38ca4be16197fa24e03e37e9db5d94d322 (diff) | |
[MERGE] forward port branch 10.0 up to e336dc38ca4
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/action_manager.js | 7 | ||||
| -rw-r--r-- | addons/web/static/src/js/framework/qweb.js | 15 |
2 files changed, 19 insertions, 3 deletions
diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js index 974bfb982d7..a31b0900863 100644 --- a/addons/web/static/src/js/action_manager.js +++ b/addons/web/static/src/js/action_manager.js @@ -385,6 +385,10 @@ var ActionManager = Widget.extend({ return this.inner_widget; }, history_back: function() { + if (this.dialog) { + this.dialog_stop(); + return; + } var nb_views = this.inner_action.get_nb_views(); if (nb_views > 1) { // Stay on this action, but select the previous view @@ -861,7 +865,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: session.debug}); @@ -872,6 +876,7 @@ var ActionManager = Widget.extend({ return $.Deferred(); // The action is finished only when the redirection is done } else { window.open(url, '_blank'); + options.on_close(); } return $.when(); }, diff --git a/addons/web/static/src/js/framework/qweb.js b/addons/web/static/src/js/framework/qweb.js index 50742075e05..253e948d8ac 100644 --- a/addons/web/static/src/js/framework/qweb.js +++ b/addons/web/static/src/js/framework/qweb.js @@ -5,7 +5,18 @@ var translation = require('web.translation'); var _t = translation._t; -function QWeb(debug, default_dict) { +/** + * @param {boolean} debug + * @param {Object} default_dict + * @param {boolean} [enableTranslation=true] if true (this is the default), + * the rendering will translate all strings that are not marked with + * t-translation=off. This is useful for the kanban view, which uses a + * template which is already translated by the server + */ +function QWeb(debug, default_dict, enableTranslation) { + if (enableTranslation === undefined) { + enableTranslation = true; + } var qweb = new QWeb2.Engine(); qweb.default_dict = _.extend({}, default_dict || {}, { '_' : _, @@ -16,7 +27,7 @@ function QWeb(debug, default_dict) { 'csrf_token': odoo.csrf_token, }); qweb.debug = debug; - qweb.preprocess_node = preprocess_node; + qweb.preprocess_node = enableTranslation ? preprocess_node : function () {}; return qweb; } |
