Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6912 มุมมอง

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?
 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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,

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ส.ค. 22
9603
1
มี.ค. 22
6271
2
มิ.ย. 18
8831
0
มี.ค. 15
3481
0
ก.ค. 25
48