Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4953 Lượt xem

Some one can told me which is the correct way to add js library to a odoo v16 website via custom addon ? 


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Put the JavaScript file under module_name -> static -> src-> js folder.

You can create the directory if you haven’t.

And in manifest,

'assets': {
'web.assets_frontend': [
'module_name/static/src/js/file_name.js’]
}

Regards

Ảnh đại diện
Huỷ bỏ

Hi Cybrosys,
As you said, I added JavaScript and CSS custom module files to the manifest file, but none of them are added, and they don't work!
How should I fix it? Or should I check if they are added correctly or not?
'assets': {
'web.assets_frontend': [
'energy_website/static/src/scss/b_theme.scss',
'energy_website/static/src/scss/b_style.scss',
'energy_website/static/src/js/b_script.js',
'energy_website/static/src/js/b_myscript.js'
]
}

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 25
3128
1
thg 4 24
2081
0
thg 1 24
1662
1
thg 9 23
3083
2
thg 4 23
5238