This question has been flagged
2 Replies
9606 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 -


Avatar
Discard
Best Answer

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

Avatar
Discard
Best Answer

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

Avatar
Discard
Author

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.