From 95468505f0bf1e71bcfb6ab73d893f0a1b9e4dc5 Mon Sep 17 00:00:00 2001
From: prye-odoo <prye@odoo.com>
Date: Fri, 18 Aug 2023 13:02:41 +0000
Subject: [PATCH] [FIX] l10n_de: remove l10n_de_document_title field from
 template

When the user configures the 'external_layout_din5008' layout template in the
general settings and tries to any QWeb reports, that case generates the
traceback.

Steps to reproduce:
- Install the 'l10n_de' and 'sale_timesheet' modules.
- Settings > General Settings
- Search for 'Document Layout' and configure the 'external_layout_din5008'
  layout.
- Settings > Technical > User Interface > Views
- Search the 'external_layout_din5008'  QWeb template view.
- Search  '<span t-if="not o and not docs">
<t t-esc="company.l10n_de_document_title"/></span>'
  line and replace by,
'<span t-if="company"><t t-esc="company.l10n_de_document_title"/></span>'
- Go to the Sales menu and print any reports from the print menu.
After that, a traceback was generated.
Error:
AttributeError: 'res.company' object has no attribute 'l10n_de_document_title'
Template: l10n_de.external_layout_din5008

The 'l10n_de_document_title' field does not exist in the 'res.company'
object and also this field used in 'l10n_de.external_layout_din5008'
template, and this template is configured as layout.  So, remove this line from
this template.
Code reference:
https://github.com/odoo/odoo/blob/14.0/addons/l10n_de/report/din5008_report.xml#L109

Sentry-4283510443

closes odoo/odoo#128559

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
---
 addons/l10n_de/report/din5008_report.xml | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/addons/l10n_de/report/din5008_report.xml b/addons/l10n_de/report/din5008_report.xml
index 77f06e8bea16..f0a31e7d85d9 100644
--- a/addons/l10n_de/report/din5008_report.xml
+++ b/addons/l10n_de/report/din5008_report.xml
@@ -106,12 +106,9 @@
                         </tr>
                     </table>
                     <h2>
-                        <span t-if="not o and not docs"><t t-esc="company.l10n_de_document_title"/></span>
-                        <span t-else="">
-                            <t t-set="o" t-value="docs[0]" t-if="not o" />
-                            <span t-if="'l10n_de_document_title' in o"><t t-esc="o.l10n_de_document_title"/></span>
-                            <span t-elif="'name' in o" t-field="o.name"/>
-                        </span>
+                        <t t-set="o" t-value="docs[0]" t-if="not o" />
+                        <span t-if="'l10n_de_document_title' in o"><t t-esc="o.l10n_de_document_title"/></span>
+                        <span t-elif="'name' in o" t-field="o.name"/>
                     </h2>
                     <t t-raw="0"/>
                 </div>
-- 
GitLab