Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
9696 Vizualizări

Hi,

I'm trying to setup, that the header (our company logo) will only be displayed on the first page.

I have researched a lot and just founded solutions for older versions (v10 & lower) or I just wasn't able to set it up.

It's regarding Odoo V12.


Update: 

After changing the code, the Header & Footer are completely gone on all pages. Just in the preview it will be displayed, but not if I download the PDF. 
I have already re-installed the Wkhtmltopdf 0.12.5–1 extension & also checked the report url inside the system parameters (this is already set to http://127.0.0.1:8069) - no success.


Our template which we are using (UPDATED @27 December)

<?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>
<div>
<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;">
just 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;">
just some tex there
</div>
<div style="color:white; margin-left:65px; width:auto; height:auto; font-family:Arial !important; font-size:0.8em !important; float:left !important;">
just some text here
Seite <span class="page"/>/<span class="topage"/>
</div>
</div>
</div>
</t>



Imagine profil
Abandonează
Cel mai bun răspuns

use basic layout on your report and put your header inside the page class so the header will be only on the first page


<template id="report_sale_order_custom_document">
<t t-call="web.basic_layout"> 
 <t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/>​
<div class="page">
//put your header code here
</div>
 </t>
</template>
Imagine profil
Abandonează
Autor Cel mai bun răspuns

Hi @alvinadjie, thanks for the tip.

Can you please explain this in detail?

I have tried to merge this into our Report, which is called external_layout_din5008 and the external ID is  l10n_de.external_layout_din5008.

My Code looks now like this, but now the logo / header and also the footer is on all pages invisible.

And really strange is, that on the preview the logo / header & footer will be there, but when I'm download / print the invoice, header / logo & also the footer are gone?!

I have updated my originally code above.


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iul. 23
11243
2
mai 24
7681
2
feb. 21
4939
1
iun. 25
25041
3
apr. 23
6959