Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
29597 มุมมอง

Hi, 

All my Q-Web reports (invoice, sale order, purchase, etc) are missing the css in pdf export and are all good in html export... Can anyone please help? I am running ubuntu 14.04 and wkhtmltopdf 12.01... Next is a preview of the problem on the left, and the html export with the css tables on the right... 

Thanks

อวตาร
ละทิ้ง

Hi, I want to reproduce the problem. When export and dialog save file opened. Don't immediately save the file, but check the server in /tmp. There should be some report*.html files. Can you share the files?

Ups, I was wrong, sorry.

ผู้เขียน คำตอบที่ดีที่สุด

Ok, its solved. I had 2 diferent problems:

 

1 - the css must be added directly to the report

2 - The url parameter must have a :8069 at the end

 

Hope this helps for others.

 

 

อวตาร
ละทิ้ง

The second options works for me

คำตอบที่ดีที่สุด

The global parameter Theo describes can be found in

Settings > Technical > Parameters > System Parameters

This can only be accessed when in 'debug' mode, add url parameter ?debug after web in your browser address bar.

You have to create a new record with

key:    report.url

value:    http://localhost:8069

Further discussion here.. https://github.com/odoo/odoo/issues/2934

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I want to give my 2 cents on this!

If you are loading your instance in port 80, you should've probably added the iptable record in your system. Then you've tried to print an invoice and everything is screwed. Ok!

Because you've changed the URL we need to say Odoo where are the assets now and because the project doesn't know anything about the iptable record you need to specify where the assets (css) are, so adding the following record to your system global parameters will solve the issue. 

Go to debug mode, either by adding the `?debug` parameter at the end of the URL or clicking in the profile at the top right and then on About. You'll see a popup with a button that says `Activate debug mode`. If you don't see it, you're not logged in as Administrator!

Go to Settings > Parameters > System Parameters

Add the following key/value:

Key: `report.url`

Value: `http://localhost:8069`

Those exact values! localhost is not a placeholder, use that exact same URL!

Try to print an invoice ;)

You're welcome!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Actually if you are sitting behind some kind of proxy (containerized odoo/ngix/squid etc) you need to set a global parameter 'report.url' = 'http://localhost:8069' and it will work like a charm all the time.


Regards

Theo


อวตาร
ละทิ้ง

you are amazing man! the localhost solved the problem i have been looking to fix for the last 2 weeks!!!

คำตอบที่ดีที่สุด

If you imported a database from another domain, it could be that web.base.url​ is set to the old one.

Here's how to update this using psql:

psql -d $LOCAL_DB -c "UPDATE ir_config_parameter SET value = '${NEW_BASE_URL}' WHERE key = 'web.base.url'"

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ย. 24
690
1
ก.พ. 24
2618
Odoo 12, Css not applied to qweb reports แก้ไขแล้ว
3
ม.ค. 20
6597
4
ต.ค. 24
52205
2
ต.ค. 23
4104