[FIX] account: fix l10n_ch qr & din5008 display

Germany and Switzerland both use the DIN5008 paper layout and encoutered some issues while printing an invoice's pdf.

In Germany, the display of pdf invoices changed with v16.0. The header and footer would always display borders, which would mess up the rest of the display.

Adding the 'table-borderless' class solved this problem.

In l10n_ch, this issue was also encountered, and the general display of the qr bill page was set off. This is problematic since this display is highly rigid.

Those changes seem to be linked to wkhtmltopdf unability to process some of the Bootstrap5 changes.

While waiting for a more long term solution regarding wkhtmltopdf and BS5 compatibility, calling directly the adequate external_layout allows us to get back a correct QR Bill.

task-3037921

closes odoo/odoo#105464

X-original-commit: 627b0f581801705f8e2d2f2bead5176e9af884f8
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
This commit is contained in:
Camille Spiritus
2022-11-14 13:01:49 +01:00
parent c90b2f7c46
commit 2aff77efe0
3 changed files with 6 additions and 7 deletions
+2 -3
View File
@@ -14,9 +14,8 @@
<template id="l10n_ch_swissqr_template">
<t t-set="o" t-value="o.with_context(lang=lang)"/>
<t t-call="web.external_layout">
<!-- TODO master: remove this -->
<script t-if="0">document.body.className += " l10n_ch_qr";</script>
<t t-set="company" t-value="o.company_id"/>
<t t-call="web.external_layout_standard">
<!-- add default margin for header (matching A4 European margin) -->
<t t-set="report_header_style">padding-top:6.2mm; padding-left:8.2mm; padding-right:8.2mm;</t>
@@ -10,7 +10,7 @@
$l10n-ch-qr-ratio: 1.25;
body.l10n_ch_qr, body[data-oe-report="l10n_ch.l10n_ch_qr_report"] {
body.l10n_ch_qr{
padding: 0;
span{
padding-left: 10mm;
@@ -35,7 +35,7 @@
<template id="external_layout_din5008">
<div>
<div t-attf-class="header din_page o_company_#{company.id}_layout">
<table class="company_header" t-att-style="'height: %dmm;' % (din_header_spacing or 27)">
<table class="company_header table-borderless" t-att-style="'height: %dmm;' % (din_header_spacing or 27)">
<tr>
<td><h3 class="mt0" t-field="company.report_header"/></td>
<td><img t-if="company.logo" t-att-src="image_data_uri(company.logo)" t-att-style="'max-height: %dmm;' % (din_header_spacing or 27)"/></td>
@@ -44,7 +44,7 @@
</div>
<div t-attf-class="din_page invoice_note article o_company_#{company.id}_layout" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id">
<table>
<table class="table-borderless">
<tr>
<td>
<div class="address">
@@ -117,7 +117,7 @@
</div>
</div>
<div class="company_details">
<table>
<table class="table-borderless">
<tr>
<td>
<ul class="list-inline">