Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
7681 Lượt xem

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>
Ảnh đại diện
Huỷ bỏ

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"?

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 24
2555
1
thg 6 23
2706
2
thg 8 20
9669
1
thg 12 23
2093
0
thg 11 20
4201