From d45ea26e3bbfa4ff3d0d9db24517fa51c00a9d92 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 5 Aug 2024 10:25:51 +0200 Subject: [PATCH] fixup! [ADD] datev_export_dtvf_nitrokey --- .../models/datev_export_dtvf.py | 11 +++++++---- datev_export_dtvf_nitrokey/tests/__init__.py | 1 + .../tests/test_datev_export_dtvf_nitrokey.py | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 datev_export_dtvf_nitrokey/tests/__init__.py create mode 100644 datev_export_dtvf_nitrokey/tests/test_datev_export_dtvf_nitrokey.py diff --git a/datev_export_dtvf_nitrokey/models/datev_export_dtvf.py b/datev_export_dtvf_nitrokey/models/datev_export_dtvf.py index 99959e8..c6cb484 100644 --- a/datev_export_dtvf_nitrokey/models/datev_export_dtvf.py +++ b/datev_export_dtvf_nitrokey/models/datev_export_dtvf.py @@ -11,8 +11,11 @@ def _get_data_transaction(self, move): for data in super()._get_data_transaction(move): for line in move.line_ids: for field_name in ("ref", "name", "move_name"): - if (line[field_name] or "").startswith("SO") or ( - line[field_name] or "" - ).startswith("EK"): - data["Belegfeld 1"] = line[field_name] + for token in (line[field_name] or "").split(): + if ( + token.startswith("SO") + or token.startswith("EK") + or token.startswith("GSV") + ): + data["Belegfeld 1"] = token yield data diff --git a/datev_export_dtvf_nitrokey/tests/__init__.py b/datev_export_dtvf_nitrokey/tests/__init__.py new file mode 100644 index 0000000..f3f2b44 --- /dev/null +++ b/datev_export_dtvf_nitrokey/tests/__init__.py @@ -0,0 +1 @@ +from . import test_datev_export_dtvf_nitrokey diff --git a/datev_export_dtvf_nitrokey/tests/test_datev_export_dtvf_nitrokey.py b/datev_export_dtvf_nitrokey/tests/test_datev_export_dtvf_nitrokey.py new file mode 100644 index 0000000..370f132 --- /dev/null +++ b/datev_export_dtvf_nitrokey/tests/test_datev_export_dtvf_nitrokey.py @@ -0,0 +1 @@ +from odoo.addons.datev_export_dtvf.tests.test_datev_export_dtvf import TestDatevExportDtvf