Skip to Content
Menu
This question has been flagged

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
Discard
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
Discard
Related Posts Replies Views Activity
2
Jan 24
5153
4
Jun 24
1410
0
Mar 24
843
2
Mar 24
1829
1
Feb 24
1939