I'm looking for a way to override some openerp web js core functions such as "on_logout".
The docs lack of instructions (as you can see in my post) and the helloworld module tells you that you can do it like
openerp.web_hello = function(openerp) {
openerp.web.SearchView = openerp.web.SearchView.extend({
init:function() {
this._super.apply(this,arguments);
this.on_search.add(function(){console.log('hello');});
}
});
// here you may tweak globals object, if any, and play with on_* or do_* callbacks on them
openerp.web.Login = openerp.web.Login.extend({
start: function() {
console.log('Hello there');
this._super.apply(this,arguments);
}
});
};
In my module I'm doing this:
openerp.mytest = function(openerp){
openerp.web.WebClient = openerp.web.WebClient.extend({
on_logout: function() {
alert('mine');
[...]
},
});
}
I know js is loaded since putting an alert outside this definition works.
What's wrong here?