Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
7010 Представления

Hello I would like to inherit JavaScript file gantt.js in web_gantt module.

My code is like that

openerp.mrp_smart_planning = function(instance){
    var module = instance.web_gantt;
    module.GanttView.include({
        init : function(){
            alert('Hello!');
            module._super();
        },
    });
};

(in file named mrp_smart_planning.js)

After reloading webpage, when I want to see gantt view "Hello" alert appear, but after shows windows with text below: Uncaught TypeError: Cannot read property '_model' of undefined

Аватар
Отменить

What are you trying to achieve.

Автор

I want modify gantt view

Автор Лучший ответ

I found a solution.

openerp.mrp_smart_planning = function(instance){
var module = instance.web_gantt;
module.GanttView.include({
    init : function(view, node){
        alert('Hello!');
        this._super(view, node);
    },
});
};
Аватар
Отменить
Лучший ответ

Try with this:

openerp.mrp_smart_planning = function(instance){
var module = instance.web_gantt;
module.GanttView=module.GanttView.extend({
    init : function(){
        alert('Hello!');
        this._super();
    },
});

};

Аватар
Отменить
Автор

Unfortunately after applying your code error still appear. T_T

Related Posts Ответы Просмотры Активность
0
сент. 23
2144
1
авг. 24
3033
1
мая 25
8046
1
нояб. 24
4685
0
мая 24
1919