Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1933 Vistas

Hey there,


I am quite new to Odoo, so it's still a little confusing to me. I am running Odoo v15 Community Edition.


As many people I am starting out with trying to adapt the report template default layout to a more suitable look for invoices, etc.


I do have a css file, that creates header and footers as well as page marks, address positions etc and want to use it to adapt the default or create a new template.


As it's Odoo v15, i added the css file to the assets_common via the manifest file as described in the documentation.

However, even after rebuilding the assets bundles and looking at the assets in the debugging mode, the css is not included.


The module installs fine this way, I tried giving the path with or without leading slash, made sure the path is correct,...without success.

I can overwrite the header/footer and include

Avatar
Descartar
Autor

Sry, somehow the text was cut and lot's of important information is missing. I can include the css via a new template in the <head>, but then it's not added to the assets (even after rebuilding assets bundles) and wkhtmltopdf doesn't seem to use it. I also tried adding it via reports_assets_common, as described in the documentation for adding fonts, but trying to install the module an error occurs: external id web reports_assets_common id does not exist.

So I am lost, I think I am following the documentation but it does't seem t work. I don't know how to debug the problem.

Autor Mejor respuesta

Thx a lot, after regnerating with the wildcards the file can now at least are added to the assets! It just doesn't help with the pdf generation, but that's a topic for a new thread I guess...

Avatar
Descartar
Mejor respuesta

Please try this code structure. It works for me.

'assets': {
'web.assets_qweb': [
'my_module/static/src/xml/*',
],
'web.assets_backend': [
'my_module/static/src/components/**/*',
'my_module/static/src/scss/**/*',
'my_module/static/src/scss/*',
'my_module/static/lib/*',
'my_module/static/src/js/**/*',
'my_module/static/src/js/*',
],

}
scss file save in static/src/scss
Avatar
Descartar