Ordne Anlagen und Belege im Übergabepaket pro Hauptschriftstück zu.
Deploy Development / deploy (push) Successful in 28s
Test Suite / pytest-backend (push) Failing after 1m38s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 9s

Statt gemeinsamem anlagen-arbeitsstand und Datumsordnern auf Kapitel-Ebene liegen zugeordnete Dateien unter Dokumentname/Anlagen bzw. Belege, damit mehrere Schreiben im gleichen Kapitel vollständig und eindeutig exportiert werden.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-18 14:32:05 +02:00
1 parent 5b23e4aab0
commit 2b23992a1a
3 files changed
+152 -7

No files matched your search

+21 -5
View File
@@ -608,18 +608,34 @@ def _emit_loose(node, prefix, add, entries, loaded, notice_for, generated: str,
_emit_related(node, prefix, add, entries, loaded, notice_for, chosen, generated)
def _host_bundle(prefix: list[str], host: ExportNode) -> list[str]:
"""Correspondence files stay under the host title, not a shared chapter folder."""
return prefix + [_segment(host.title)]
def _related_bucket(node: ExportNode) -> str:
if node.kind == "attachment":
return "Anlagen"
if node.kind == "evidence":
return "Belege"
if node.kind == "dispatch_item":
relation = node.relation or ""
if "Anlage → Versand" in relation:
return "Anlagen"
return "Belege"
return "Belege"
def _emit_related(node, prefix, add, entries, loaded, notice_for, chosen, generated: str) -> None:
bundle = _host_bundle(prefix, node)
for child in node.children:
if child.kind == "attachment" and child.id in chosen and child.id in loaded:
_emit_one(child, prefix + ["anlagen-arbeitsstand"], add, entries, loaded, notice_for, generated)
_emit_one(child, bundle + ["Anlagen"], add, entries, loaded, notice_for, generated)
if child.kind != "dispatch":
continue
picked = [item for item in child.children if item.id in chosen and item.id in loaded]
if not picked:
continue
folder = prefix + [_segment(child.title)]
for item in picked:
_emit_one(item, folder, add, entries, loaded, notice_for, generated)
_emit_one(item, bundle + [_related_bucket(item)], add, entries, loaded, notice_for, generated)
def _emit_one(node, prefix, add, entries, loaded, notice_for, generated: str) -> None: