[FIX] l10n_din5008: correctly print invoice without headers

Steps to reproduce
------------------
* install `l10n_ch_reports`
* switch to a Swiss company
* enable "QR Codes" in Settings > Accounting > Customer Payments
* create and confirm two invoices for a Swiss partner
* on the invoice list view, select and attempt to print the two invoices
  at once

You should be met with traceback.

opw-3697569

closes odoo/odoo#154063

X-original-commit: b6cb6b3ecd80d8c919790cc3178dfcb62f6f49fb
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
This commit is contained in:
sesn-odoo
2024-02-15 07:54:49 +00:00
parent 882c852603
commit 73db0b49da
@@ -46,9 +46,8 @@
<div t-attf-class="din_page invoice_note article o_company_#{company.id}_layout {{'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else ''}} #{'din_page_pdf' if report_type == 'pdf' else ''}"
t-attf-style="background-image: url({{ 'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/bg_background_template.jpg' if company.layout_background == 'Geometric' else ''}});"
t-att-data-oe-model="o and o._name"
t-att-data-oe-id="o and o.id"
t-if="not skip_headers">
<table class="din_company_info table-borderless">
t-att-data-oe-id="o and o.id">
<table class="din_company_info table-borderless" t-if="not skip_headers">
<tr>
<td>
<div class="address">
@@ -105,7 +104,7 @@
</tr>
</div>
</table>
<h2>
<h2 t-if="not skip_headers">
<span t-if="not o and not docs"><t t-out="company.l10n_din5008_document_title"/></span>
<span t-else="">
<t t-set="o" t-value="docs[0]" t-if="not o" />