Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

css not loading in qweb report...

By
Brijesh Kesariya
on 11/4/16, 3:27 AM 182 views

Hello,

I have prepared one qweb report in Odoo v9 to print Customer Statement. Its working fine when I print it from Odoo UI.

But the problem is, When I use Scheduler to mail the same Customer Statement Report, the formatting of the report get changed and header and footer are missing in it. I also check the log but it says that 2 css files are not found as below.

Please help me, how I could load those css files when I mail my report from scheduler or if am I doing any other mistake?


Many Thanks in Advance.

TRACEBACK :

2016-11-04 07:16:46,090 2450 INFO ? werkzeug: 127.0.0.1 - - [04/Nov/2016 07:16:46] "GET /web/content/4175-9a5a204/report.assets_pdf.0.css HTTP/1.1" 404 -

2016-11-04 07:16:46,092 2450 INFO ? werkzeug: 127.0.0.1 - - [04/Nov/2016 07:16:46] "GET /web/content/4170-3a12d15/report.assets_common.0.css HTTP/1.1" 404 -


3
Ameera PP
On 11/4/16, 4:28 AM

Hi,

You can add css in report like below:

inside <div class="page">      you can add:

                       <link rel='stylesheet' href='/module_name/static/src/css/report.css'/>

Also you need to define your css in report.css file

2
shameem@aχoncoms
On 11/4/16, 3:52 AM

Hi Brijesh,

You can use css like this

     ...............
<div class="page">

     <style>
         //Your styles
     </style>
     ...............
</div>

Or direct styling

<div style="background-color:blu;.........etc...........">

also ensure wkhtmltopdf is installed

All the best

Thanks for the reply.

Yes I have used css same way you are saying. wkhtmltopdf is also installed and all the things are working properly when I click "Print" Button from UI.

But only issue is in report generation using Scheduler.

Brijesh Kesariya
on 11/4/16, 4:30 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/4/16, 3:27 AM
Seen: 182 times
Last updated: 11/8/16, 8:18 AM