Skip to Content
Menu
This question has been flagged
2 Replies
7151 Zobrazenia

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

Avatar
Zrušiť

What are you trying to achieve.

Autor

I want modify gantt view

Autor Best Answer

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);
    },
});
};
Avatar
Zrušiť
Best Answer

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();
    },
});

};

Avatar
Zrušiť
Autor

Unfortunately after applying your code error still appear. T_T

Related Posts Replies Zobrazenia Aktivita
0
sep 23
2323
1
aug 24
3192
1
máj 25
8248
1
nov 24
4939
0
máj 24
2097