Я ищу способ переопределить некоторые основные функции openerp web js, такие как «on_logout».
В документах отсутствуют инструкции (как вы можете видеть в мой пост) и модуль helloworld говорит вам, что вы можете сделать это как
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);
}
});
};
В моем модуле я делаю это:
openerp.mytest = function(openerp){
openerp.web.WebClient = openerp.web.WebClient.extend({
on_logout: function() {
alert('mine');
[...]
},
});
}
Я знаю, что js загружается, так как работает оповещение вне этого определения.
Что здесь не так?