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