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.

0

Why won't my custom javascript module load?

By
Julian Solorzano
on 9/11/14, 12:35 PM 1,618 views

I've followed what the docs and various tutorials say about creating custom JS modules.

I created this file 

console.log("I'm here!!");
openerp.mymodule = function(instance){
    console.log("loading my module...");
};

and placed it in the static/src/js folder of the module. I added this path to the "js" key of the manifest file.

When I open the browser console and load the page, "I'm here" does get printed, but "loading my module..." never does. What am I missing?
 

1

Grover Menacho

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

Systems Engineer + MBA

Grover Menacho
On 9/11/14, 7:01 PM

It depends. If you are using JS on v7 or V8.

In v7 you can add it to __openerp__.py.

In v8 you have to add it to views

Anyways, I think that you made it work. So the main reason must be:

you module name is not named 'mymodule'

in order to make it work please set that openerp.module_name

Duh! That was it. Thank you very much,

Zenpar S.A. de C.V., Julian Solorzano
on 9/11/14, 7:45 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

1 follower(s)

Stats

Asked: 9/11/14, 12:35 PM
Seen: 1618 times
Last updated: 3/16/15, 8:10 AM