From e9a54a5c1187ba9b9a0a263eb6519806dc0c79a5 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 7 Dec 2011 17:13:53 +0100 Subject: [PATCH] [IMP] Raise console.error when no action.type defined I see this error from times to times but never had a chance to reproduce it. console.error will give a traceback + action object in order to fix the issue bzr revid: fme@openerp.com-20111207161353-vnp6dm21xyedxgeg --- addons/web/static/src/js/views.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 403aa7ca87a..cae83d48258 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -75,6 +75,10 @@ session.web.ActionManager = session.web.Widget.extend({ } }, do_action: function(action, on_close) { + if (!action.type) { + console.error("No type for action", action); + return; + } var type = action.type.replace(/\./g,'_'); var popup = action.target === 'new'; action.flags = _.extend({ @@ -85,7 +89,7 @@ session.web.ActionManager = session.web.Widget.extend({ pager : !popup }, action.flags || {}); if (!(type in this)) { - console.log("Action manager can't handle action of type " + action.type, action); + console.error("Action manager can't handle action of type " + action.type, action); return; } return this[type](action, on_close);