Skip to Content
Menú
This question has been flagged
1 Respondre
2175 Vistes

I'm using odoo 16. Apparently odoo 16 is using bootstrap 5. I have a problem when using the bootstrap class in a pdf report. In HTML view, there is no problem. But once I print as PDF, it breaks. Then I found that bootstrap 5 is not stable for wkhtmltopdf. 


https://github.com/odoo/odoo/issues/136360#:~:text=Here%20are%20at%20least%205%20things%20the%20Odoo%20team%20could%20have%20done%20to%20mitigate%20this%20issue%3A 


I want to try using bootstrap 4 in report pdf only. How can I achieve this?

Avatar
Descartar
Best Answer

Hi,

To do that in your manifest in web._assets_bootstrap 
Add these lines

'web._assets_bootstrap': [
            (‘after’,’web/static/src/scss/import_bootstrap.scss', your_module/static/src/scss/import_bootstrap_4.scss’),
]

Make sure that you have a file named import_bootstrap_4 which has bootstrap v4 in it

Alternatively you could also try
'web._assets_bootstrap': [
            (‘remove’,’web/static/src/scss/import_bootstrap.scss')
            your_module/static/src/scss/import_bootstrap_4.scss’,
]

Hope it helps

Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de gen. 24
5604
4
de juny 24
1972
0
de març 24
1171
2
de març 24
2514
1
de febr. 24
2557