Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Inherit Java Script file

By
Tadeusz Karpiński
on 10/9/13, 10:04 AM 1,960 views

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.

IBS
on 10/9/13, 10:34 AM

I want modify gantt view

Tadeusz Karpiński
on 10/9/13, 10:44 AM
1
Tadeusz Karpiński
On 10/10/13, 6:04 AM

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

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 10/9/13, 1:50 PM

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

Tadeusz Karpiński
on 10/9/13, 4:25 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 10/9/13, 10:04 AM
Seen: 1960 times
Last updated: 3/16/15, 8:10 AM