Skip to content

Qweb reports missing css on pdf export #2934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adegas opened this issue Oct 6, 2014 · 30 comments
Closed

Qweb reports missing css on pdf export #2934

adegas opened this issue Oct 6, 2014 · 30 comments
Assignees

Comments

@adegas
Copy link

adegas commented Oct 6, 2014

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...

https://www.odoo.com/forum/help-1/question/qweb-reports-missing-css-on-pdf-export-64335

Thanks

@sle-odoo sle-odoo self-assigned this Oct 6, 2014
@sle-odoo
Copy link
Contributor

sle-odoo commented Oct 6, 2014

Hello,
Is there a paper format defined on your company?
Could you paste here the log when you print an invoice?
Do you use a reverse proxy to access your odoo instance?

Thanks

@adegas
Copy link
Author

adegas commented Oct 6, 2014

Log:

2014-10-06 16:05:28,568 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:28] "POST /web/dataset/call_kw/account.invoice/fields_view_get HTTP/1.1" 200 -
2014-10-06 16:05:29,309 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/call_kw/account.invoice/read HTTP/1.1" 200 -
2014-10-06 16:05:29,369 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-10-06 16:05:29,386 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-10-06 16:05:29,387 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-10-06 16:05:29,428 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-10-06 16:05:29,479 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/call_kw/res.partner/name_get HTTP/1.1" 200 -
2014-10-06 16:05:29,527 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/call_kw/res.company/name_search HTTP/1.1" 200 -
2014-10-06 16:05:29,569 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/call_kw/account.journal/name_search HTTP/1.1" 200 -
2014-10-06 16:05:29,626 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/call_kw/account.invoice/read_followers_data HTTP/1.1" 200 -
2014-10-06 16:05:29,708 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-10-06 16:05:29,725 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/call_kw/mail.message/message_read HTTP/1.1" 200 -
2014-10-06 16:05:29,832 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "GET /web/binary/image?model=res.partner&field=image_small&id=3&resize= HTTP/1.1" 200 -
2014-10-06 16:05:29,842 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/call_kw/account.invoice/message_get_subscription_data HTTP/1.1" 200 -
2014-10-06 16:05:29,923 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:29] "POST /web/dataset/call_kw/mail.message/set_message_read HTTP/1.1" 200 -
2014-10-06 16:05:30,155 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:30] "POST /web/dataset/call_kw/account.invoice.line/read HTTP/1.1" 200 -
2014-10-06 16:05:33,650 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:33] "POST /web/action/load HTTP/1.1" 200 -
2014-10-06 16:05:33,720 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:33] "POST /report/check_wkhtmltopdf HTTP/1.1" 200 -
2014-10-06 16:05:34,742 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:34] "POST /report/download HTTP/1.1" 200 -
2014-10-06 16:05:46,723 23052 INFO demov8 werkzeug: 85.247.10.174 - - [06/Oct/2014 16:05:46] "POST /longpolling/poll HTTP/1.1" 200 -
2014-10-06 16:05:50,507 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:50] "POST /longpolling/poll HTTP/1.1" 200 -
2014-10-06 16:05:58,664 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:05:58] "POST /longpolling/poll HTTP/1.1" 200 -
2014-10-06 16:06:06,106 23052 INFO demov8 werkzeug: 89.153.85.172 - - [06/Oct/2014 16:06:06] "POST /longpolling/poll HTTP/1.1" 200 -

Report pdf - when is bad:

fatura v8 error

Report html - when is good:

fatura odoo v8

No we dont use reverse proxy.

Thanks

@sle-odoo
Copy link
Contributor

sle-odoo commented Oct 8, 2014

looks like wkhtmltopdf does not use the right base url: could you check in settings > parameters > system parameters that the key web.base.url has a correct value?

@adegas
Copy link
Author

adegas commented Oct 8, 2014

Hi, thanks for replying.

The link for database is http://demov8.opencloud.pro and the url parameter is the same.

What you suggest?

@sle-odoo
Copy link
Contributor

sle-odoo commented Nov 6, 2014

Hi,
Please update your codebase and try to create the parameter key "report.url" to an internal url, such as http://127.0.0.1:8069.
It should fix the issue. If you can't get it working, feel free to reopen this.

Regards

@sle-odoo sle-odoo closed this as completed Nov 6, 2014
@Chris-M4gic
Copy link

Parameter key "report.url" works for me only in debug mode. Why could this be happening?

@yucer
Copy link

yucer commented Jul 18, 2016

Note that v9 needs the debug mode enabled to allow you access the system settings.

Also, I have verified that after adding the "report.url" value you need to log off/on again in order to see the reports working right.

@gustavovalverde
Copy link
Contributor

Why is there a need to do this? If there's no documentation in the installation to do it, then it's actually a bug. After the Wkhtml install it should work, otherwhise is a bug. This happens with every reversed proxy installation I make.

@dansanti
Copy link
Contributor

dansanti commented Sep 3, 2016

Hi!

This trouble is for people that use port redirect via firewall or some similar, and have a domain filter.
In my case, if I use port redirct via iptables + domainfilter, any pdf is printing with CSS, but now that to that installation I add Apache reverse proxy and now CSS works fine

@rubiagatra
Copy link

@dansanti Could you explain more? I use mikrotik as a firewall and nat

@Ark74
Copy link
Contributor

Ark74 commented Aug 19, 2017

For Odoo 10 you require wkhtmltopdf 12.4.

Cheers!

@gustavovalverde
Copy link
Contributor

For Odoo 10 you require wkhtmltopdf 12.4.

@Ark74 I haven't seen that in the Documentation, could you please guide me to that information?

@Ark74
Copy link
Contributor

Ark74 commented Aug 19, 2017

Well I haven't seen that written either.
But I've been a long Odoo 8 user and now with O10, wkhtmltopdf 12.1 didn't worked as expected.

Just download 12.4 untar it, uninstall 12.1 and copy the binary to /usr/bin
cp wkhtmltox/bin/wkhtmltopdf /usr/bin/

Note: You need to set report.url to 127.0.0.1:8069 also.

Then restart your the odoo service and you're good to go.

@Ark74
Copy link
Contributor

Ark74 commented Aug 19, 2017

Let me know it that works for you.
Cheers!

@gustavovalverde
Copy link
Contributor

gustavovalverde commented Aug 19, 2017

Just to be clear:
Odoo officially recommends wkhtmltopdf 12.1: https://github.com/odoo/odoo/wiki/Wkhtmltopdf
Using this unofficial version: https://nightly.odoo.com/extra/

If you'd like to use 12.4, the right procedure to install it, as you need it with the patched QT, is this one:

Install wkhtmltopdf dependencies:
sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev git-core

Install wkhtmltopdf
wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
ln -s wkhtmltox/bin/wkhtmlto* /usr/bin/

@Ark74
Copy link
Contributor

Ark74 commented Aug 19, 2017 via email

@bunhin
Copy link

bunhin commented Sep 21, 2017

Hi All,
Please anybody help, I have problem with odoo10 community standard pdf report, all negatif sign "-" rendered into square / rectangle (odds character). I install Odoo10 on CentOS 7.3 (upgraded aslo to 7.4). I have try wkhtmltopdf version from 0.12.1, 0.12.2, 0.12.2.1, 0.12.4.

I have search for weeks in the net but can not found any solution.

@Yenthe666
Copy link
Collaborator

Hi @bunhin you're referring to #17093 - which is another issue then this topic. The problem is known and has been assigned (as you can see on the other topic).

@bunhin
Copy link

bunhin commented Sep 22, 2017

ok thank you

@Rafaellinos
Copy link

Guys, i'm facing the same issue with ODOO13, all my reports are printing without css and take a long time to print.
I tried to set report.url as http://127.0.0.1:8069 or http://localhost:8069 but it doesn't work :/
And also, alfter I print, I got "Your Odoo session expired. Please refresh the current web page." everytime.
My
I'm using odoo 13 with docker and 3 databases with dbfilter
My odoo.conf:

[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
admin_passwd = mypass
dbfilter = ^%d$

@AURANGZEBB
Copy link

!Great it worked.

@andres-pcg
Copy link

Guys, i'm facing the same issue with ODOO13, all my reports are printing without css and take a long time to print.
I tried to set report.url as http://127.0.0.1:8069 or http://localhost:8069 but it doesn't work :/
And also, alfter I print, I got "Your Odoo session expired. Please refresh the current web page." everytime.
My
I'm using odoo 13 with docker and 3 databases with dbfilter
My odoo.conf:

[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
admin_passwd = mypass
dbfilter = ^%d$

Same here.!

@yelizariev
Copy link
Contributor

yelizariev commented Nov 17, 2020

Your Odoo session expired. Please refresh the current web page.

This error happens because of dbfilter. You cannot have dbfilter = ^%d$ with report.url equal to localhost (until you database name is localhost 😉 ).

You can either change dbfilter (e.g. ^yourdbname$) or change report.url to a value which corresponds to dbfilter. At any case, be sure that report.url address is accessible from server/container where odoo is running

@andres-pcg
Copy link

@gustavovalverde check this out

@andres-pcg
Copy link

Your Odoo session expired. Please refresh the current web page.

This error happens because of dbfilter. You cannot have dbfilter = ^%d$ with report.url equal to localhost (until you database name is localhost 😉 ).

You can either change dbfilter (e.g. ^yourdbname$) or change report.url to a value which corresponds to dbfilter. At any case, be sure that report.url address is accessible from server/container where odoo is running

Thanks a lot.! I managed to play around with the hosts file and got it to work. This kind of super valuable information should be on Odoo official docs.

@yelizariev
Copy link
Contributor

It looks as a specific case for what already stated in the docs:

https://www.odoo.com/documentation/14.0/developer/howtos/backend.html

report.url, pointing to an URL reachable from your server (probably http://localhost:8069 or something similar).

if you have dbfilter = ^%d$ with report.url equal to localhost, then odoo is not available via http://localhost:8069

@andres-pcg
Copy link

andres-pcg commented Sep 28, 2021

The part about dbfilter is the one that's missing. It's almost a guess game. If you wouldn't tell me I wouldn't actually know.

However, I believe that information should be part of these docs https://www.odoo.com/documentation/14.0/administration/install/deploy.html

It's more related to the administration rather than development itself.

@yelizariev
Copy link
Contributor

@andrp92 it would be better if you make a PR with your proposial 😉 https://github.com/odoo/documentation/

@bunhin
Copy link

bunhin commented Oct 15, 2022

hi @yelizariev
I have same problem
one question is what report url to put when we have reverse proxy and multi instances where dbfilter is on with ^%d$ or ^%h$, putting same as web.base.url is not working.
what other config variable is contributing here?
I have a problem on one server, but I dont have the problem on the other with the same config I am sure (without putting a report url, under reverse proxy, and "dbfilter" on with ^%h$.

On the server with the problem the only thing work is when "dbfilter" is off, and put report.url as 0.0.0.0:8069.

@agourisse
Copy link

Hi @yelizariev @bunhin,

After adding the dbfilter option to ^%h$ in odoo conf.
You must add in /etc/hosts 127.0.0.1 test.example.com
Where %h = test.example.com

This is the settings to set in odoo :
Key Value
report.url http://test.example.com:8069/
web.base.url https://test.example.com/
web.base.url.freeze True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests