Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
7157 Visualizzazioni

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
Abbandona

What are you trying to achieve.

Autore

I want modify gantt view

Autore Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Autore

Unfortunately after applying your code error still appear. T_T

Post correlati Risposte Visualizzazioni Attività
0
set 23
2329
1
ago 24
3192
1
mag 25
8250
1
nov 24
4942
0
mag 24
2099