I've customized my sales report to look from this:
To this:
I commented the code section that shows the company information inside external_layout_header
view:
<?xml version="1.0"?>
<t t-name="report.external_layout_header">
<div class="header">
<div class="row">
<div class="col-xs-3">
<img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>
</div>
<div class="col-xs-9 text-right" style="margin-top:20px;" t-field="company.rml_header1"/>
</div>
<div class="row zero_min_height">
<div class="col-xs-12">
<div style="border-bottom: 1px solid black;"/>
</div>
</div>
<!-- COMMENTED
<div class="row">
<div class="col-xs-3">
<div t-field="company.partner_id" t-field-options="{'widget': 'contact', 'fields': ['address', 'name'], 'no_marker': true}" style="border-bottom: 1px solid black;"/>
</div>
</div>
-->
</div>
</t>
Somehow, I was expecting to reduce the space between the header and the report body. I've been trying out different ways with no luck. There's a similar question in the Odoo forum but that's for v7 with RML (deprecated). I'm using Odoo v8 QWeb report.
I already tried @Paulo's solution:
But this is not what I'm looking for. I need to gain space by moving the body near the header and not the other way around
As suggested by @Paulo's comment, playing around with the combination of fields margin_top
and header_spacing
did the trick. I reduced margin_top
from 40
to 20
and header_spacing
from 35
to 15
.
The solution is on the Paper Format: in my case A4.
You have to go to Settings > Technical > Reports > Paper Format > A4 and decrease the Header spacing value