Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1950 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
sty 24
5365
4
cze 24
1681
0
mar 24
982
Wrong PDF Format Rozwiązane
2
mar 24
2184
1
lut 24
2229