From bf29cecca3d412add5d764137835a5028de44c95 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 29 Nov 2012 11:11:37 +0100 Subject: [PATCH] [FIX] if an action descriptor is precisely ``false``, treat it as an ir_action_close ~/projects/tiny/web/current Can be seen in e.g. Quotations > [More sidebar] > Sale: Mark Unread: it's a server action which just returns ``False``, the handler resulted in a noop but also produced an error message in the browser console ("No type for action false"). Convert ``false`` (identity-tested) into an ir_action_close in do_action, before actually mucking into the action descriptor. bzr revid: xmo@openerp.com-20121129101137-g01nd49hnlg2odfs --- addons/web/static/src/js/views.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index def265d..7b58818 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -256,7 +256,9 @@ instance.web.ActionManager = instance.web.Widget.extend({ on_close: function() {}, action_menu_id: null, }); - if (_.isString(action) && instance.web.client_actions.contains(action)) { + if (action === false) { + action = { type: 'ir.actions.act_window_close' }; + } else if (_.isString(action) && instance.web.client_actions.contains(action)) { var action_client = { type: "ir.actions.client", tag: action, params: {} }; return this.do_action(action_client, options); } else if (_.isNumber(action) || _.isString(action)) { -- 1.7.10.4