Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
7163 Переглядів

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
2334
1
серп. 24
3194
1
трав. 25
8253
1
лист. 24
4949
0
трав. 24
2108