Skip to Content
Menu
This question has been flagged
1 Reply
10147 Views

Odoo v9 on Windows 7 64bit and I cannot make PDF reports use CSS styles.

So far i've tried:

  • Different versions of wkhtmltopdf (32bit/64bit)

  • Setting System Parameters
    'web.base.url' to 'http://localhost:8069'

    'web.base.url.freeze' to 'True'

    'report.url' to 'http://localhost:8069'

  • Using absolute/relative path css:

    <link href="http://localhost:8069/cds/static/src/css/cds_report.css" rel="stylesheet"/>
  •  Using internal CSS:

    <style> body { font-family: calibri; } </style>

The only thing that worked is setting the style inline:

<div style="...">


I am kinda lost by now. This is report template example:

<template id="cds2_invoice">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="cds2.cds2_invoice_document" t-lang="o.partner_id.lang" />
</t>
</t>
</template>

<template id="cds2_invoice_document">
<style>
.colored {
background-color: #4D4D73;
color:#FFF;
padding:0;
min-height:10px;
}
</style>
<div class="page">
<div class="row">
<div class="colored">
<span>ASD</span>
</div>
</div>
</div>
</template>


Avatar
Discard
Best Answer

Before

<template id="cds2_invoice">

put the next code,

<template id="my_layout" inherit_id="report.minimal_layout">

<xpath expr="//style" position="after">

<link href="MODULE_NAME/static/src/css/style.css" rel="stylesheet"/>

</xpath>

</template>


Kind Regards,

Juanvi


Avatar
Discard
Related Posts Replies Views Activity
1
Feb 23
8976
2
Apr 22
22864
3
Jan 19
8412
2
Jan 16
9609
2
Sep 24
216