From 96dab7ac9875365aa1e66695380587ed95be34cd Mon Sep 17 00:00:00 2001 From: Adrien Minet Date: Tue, 16 Nov 2021 11:49:21 +0000 Subject: [PATCH] [FIX] l10n_de: ensure o is defined in din5008 report MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit How to reproduce the bug: - install l10n_de - in Settings/General Settings/Business Documents, configure document layout to DIN 5008 - try to print one of several: => timesheet entries => direct debit mandates => follow-up reports Bug: When you use the DIN 5008 report defined in l10n_de, the o variable is defined which generates an error. closes odoo/odoo#81505 Opw: 2659703,2699563,2649221 X-original-commit: c6ffe7eb65844dad33db4390ffeeb24d61a36f40 Signed-off-by: William André (wan) --- addons/l10n_din5008/models/__init__.py | 1 + addons/l10n_din5008/models/hr_timesheet.py | 15 +++++++++++++++ addons/l10n_din5008/report/din5008_report.xml | 9 ++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 addons/l10n_din5008/models/hr_timesheet.py diff --git a/addons/l10n_din5008/models/__init__.py b/addons/l10n_din5008/models/__init__.py index 698f201289e..5205f97ee55 100644 --- a/addons/l10n_din5008/models/__init__.py +++ b/addons/l10n_din5008/models/__init__.py @@ -3,3 +3,4 @@ from . import base_document_layout from . import account_move +from . import hr_timesheet diff --git a/addons/l10n_din5008/models/hr_timesheet.py b/addons/l10n_din5008/models/hr_timesheet.py new file mode 100644 index 00000000000..afce2f45702 --- /dev/null +++ b/addons/l10n_din5008/models/hr_timesheet.py @@ -0,0 +1,15 @@ +from odoo import models, fields + +class AccountAnalyticLine(models.Model): + _inherit = 'account.analytic.line' + + l10n_din5008_template_data = fields.Binary(compute='_compute_l10n_din5008_template_data') + l10n_din5008_document_title = fields.Char(compute='_compute_l10n_din5008_document_title') + + def _compute_l10n_din5008_template_data(self): + for record in self: + record.l10n_din5008_template_data = [] + + def _compute_l10n_din5008_document_title(self): + for record in self: + record.l10n_din5008_document_title = '' diff --git a/addons/l10n_din5008/report/din5008_report.xml b/addons/l10n_din5008/report/din5008_report.xml index ba5d824d7f1..7b6d85e1c01 100644 --- a/addons/l10n_din5008/report/din5008_report.xml +++ b/addons/l10n_din5008/report/din5008_report.xml @@ -100,9 +100,12 @@

- - - + + + + + +