Skip to Content
Menu
This question has been flagged
2 Replies
5079 Views

Hi,


I made a custom header for my sale order reports.

But after I made it I realised that the first informations of my report (the name / invoice number) is hidden behind my header.

I've tried margin-bottom or margin-top at different divs but nothing seems to work.


Any idea ? Thanks in advance


The PDF report : https://i.imgur.com/rr0M1P2.png

You can see under the header grey line a little bit of the report page.


The beginning of my report :

<?xml version="1.0"?>
<t t-name="sale.report_saleorder_document">
<t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>

<div class="page">
<div class="oe_structure"/>

<h2>
<t t-if="not (env.context.get('proforma', False) or is_pro_forma)">
<span style="color:#e85830" t-if="doc.state not in ['draft','sent']">Order # </span>
<span style="color:#e85830" t-if="doc.state in ['draft','sent']">Quotation # </span>
</t>
<t t-if="env.context.get('proforma', False) or is_pro_forma">
<span style="color:#e85830">Pro-Forma Invoice # </span>
</t>
<span t-field="doc.name" style="color:#e85830"/>
</h2>

<strong><span t-field="doc.x_type_chantier"/></strong>

<div class="row mt32 mb32" id="informations">
<div t-if="doc.client_order_ref" class="col-auto mw-100 mb-2">
<strong>Your Reference:</strong>
<p class="m-0" t-field="doc.client_order_ref"/>
</div>
<div t-if="doc.confirmation_date and doc.state not in ['draft','sent']" class="col-auto mw-100 mb-2">
<strong>Date Ordered:</strong><span class="m-0" t-field="doc.confirmation_date"/>
</div>
<div t-if="doc.date_order and doc.state in ['draft','sent']" class="col-auto mw-100 mb-2">
<strong>Quotation Date:</strong>
<p class="m-0" t-field="doc.date_order"/>
</div>
<div t-if="doc.validity_date and doc.state in ['draft', 'sent']" class="col-auto mw-100 mb-2">
<strong>Expiration Date:</strong>
<p class="m-0" t-field="doc.validity_date"/>
</div>
<div name="payment_term" t-if="doc.payment_term_id" class="col-auto mw-100 mb-2" style="visibility: hidden;">
<strong>Payment Terms:</strong>
<p class="m-0" t-field="doc.payment_term_id"/>
</div>
</div>


external_layout_standard :

<?xml version="1.0"?>
<t t-name="web.external_layout_standard">
<div class="header">
<div class="row">
<div class="col-6 mb4">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 115px;" alt="Logo"/>
</div>
<div class="col-6 mb4">
<t t-if="doc.partner_shipping_id != doc.partner_invoice_id">
<strong>Adresse de chantier :</strong>
<div t-field="doc.partner_shipping_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
</t>
</div>
</div>

<div class="col-12 text-center" style="color: white; background-color:#e85830;" t-field="company.report_header" name="moto"/>

<div class="row" style="border-bottom: 4px solid grey;">
<div class="col-6" name="company_address" style="color:#805434">
<div t-field="company.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;email&quot;, &quot;phone&quot;, &quot;website&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
</div>
<div class="col-6">
<t t-if="doc.partner_shipping_id != doc.partner_invoice_id">
<strong>Adresse de facturation :</strong>
<div t-field="doc.partner_invoice_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
</t>
<t t-if="doc.partner_shipping_id == doc.partner_invoice_id">
<strong>Adresse de chantier et de facturation :</strong>
<div t-field="doc.partner_shipping_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
</t>
</div>
</div>
</div>

<div class="article o_report_layout_standard" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>

<div class="footer">
<div class="text-center" style="font-size:11px;">

<span t-field="company.report_footer"/>

<ul class="list-inline">
<li class="list-inline-item"><span t-field="doc.x_type_chantier"/></li>
<li class="list-inline-item">&amp;bull;</li>
<li class="list-inline-item"><span t-field="doc.name"/></li>
<li class="list-inline-item">&amp;bull;</li>
<li class="list-inline-item">Page : <span class="page"/> / <span class="topage"/></li>
</ul>
</div>
</div>
</t>
Avatar
Discard

Why you need address and delivery info in the header. this is a wrong practice. Add address and delivery details in page instead of header.

Best Answer

Hello

please create new paper format for this report.

you can create new paper format from the menu Settings > Reports > paper format.

and then into the paper format set the "top margin" and "header spacing" value

Avatar
Discard
Related Posts Replies Views Activity
2
Jul 18
3437
1
Mar 16
10464
1
Jul 23
1498
1
Jan 21
2083
4
Oct 20
8118