[FIX] if an action descriptor is precisely ``false``, treat it as an ir_action_close...
authorXavier Morel <xmo@openerp.com>
Thu, 29 Nov 2012 10:11:37 +0000 (11:11 +0100)
committerXavier Morel <xmo@openerp.com>
Thu, 29 Nov 2012 10:11:37 +0000 (11:11 +0100)
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

index def265d..7b58818 100644 (file)
@@ -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)) {