[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
This commit is contained in:
parent
0ae257c780
commit
e9a54a5c11
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue