Skip to Content
Menu
This question has been flagged
2 Replies
7054 Rodiniai

Hi,

I have changed my code, so that the header will only be displayed at the first page.

But now, I'm facing another issue, that the header & footer are gone on all pages, but on the preview I can see the header and also an part of the footer (it's kind of cropped - idk), but when I download the invoice, there is no footer and also no header anymore, they are just gone.

It's regarding Odoo V12 with Ubuntu 18.04.2 LTS

What I have tried so far:

  • checked the report.url inside the system parameters --> http://127.0.0.1:8069 is used

  • uninstalled the wkhtmltopdf and re-installed it (`wkhtmltopdf --version` is displaying `wkhtmltopdf 0.12.5 (with patched qt)`)

My template source-code:

<?xml version="1.0"?>
<t t-name="l10n_de.external_layout_din5008">
<t t-if="not o and doc">
<t t-set="o" t-value="doc"/>
</t>
<t t-if="o and 'company_id' in o">
<t t-set="company" t-value="o.company_id.sudo()"/>
</t>
<t t-if="not o or not 'company_id' in o">
<t t-set="company" t-value="res_company"/>
</t>
<t t-call="web.basic_layout">
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/>
<div class="page">
<div class="header">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" class="float-left" style="margin-left:95px !important; max-height:75px !important;"/>
</div>
</div>
</t>
<div class="article din" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id">
<t t-raw="0"/>
</div>
<div class="footer o_background_footer din" style="position:absolute !important; left:0mm !important; right:0mm !important; width:100% !important; height:542mm !important; background-color:#0870b0 !important; bottom:auto !important;">
<div style="height:20px !important; width:100%;">
</div>
<div style="color:white; margin-left:95px; width:auto; height:auto; font-family:Arial !important; font-size:0.8em !important; float:left !important;">
                     SOME TEXT HERE
                  </div>
<div style="color:white; margin-left:65px; width:auto; height:auto; font-family:Arial !important; font-size:0.8em !important; float:left !important;">
                    SOME TEXT HERE 
                  </div>
<div style="color:white; margin-left:65px; width:auto; height:auto; font-family:Arial !important; font-size:0.8em !important; float:left !important;">
                    SOME TEXT HERE
                    Page <span class="page"/>/<span class="topage"/>
</div>
</div>
</t>
Portretas
Atmesti

I have been searching for hours..... installed 4 different versions of wkhtmltopdf. Dev mode was the problem all along fml

Thank you Eduardo

Have you tried deactivating the developer mode and trying out to print the pdf report as a "normal user"?

Best Answer

No way! I had the same issue and deactivating developer mode fixed it! Thanks a lot!

Portretas
Atmesti
Best Answer

Thank you so much! I tried so much stuff and this was the solution. 

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
geg. 24
1764
1
birž. 23
1965
2
rugp. 20
8859
1
gruod. 23
1356
0
lapkr. 20
3682