Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
7156 Zobrazení

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šit

What are you trying to achieve.

Autor

I want modify gantt view

Autor Nejlepší odpověď

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šit
Nejlepší odpověď

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šit
Autor

Unfortunately after applying your code error still appear. T_T

Related Posts Odpovědi Zobrazení Aktivita
0
zář 23
2329
1
srp 24
3192
1
kvě 25
8250
1
lis 24
4942
0
kvě 24
2099