Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4961 Visualizzazioni

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


Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona

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'
]
}

Post correlati Risposte Visualizzazioni Attività
1
ago 25
3138
1
apr 24
2096
0
gen 24
1671
1
set 23
3095
2
apr 23
5258