Hallo!
Ich migriere gerade alle ODT-Vorlagen aus meinem alten System hin zu Dolibarr und musste dazu natürlich auch die entsprechenden Tags zur automatischen Ersetzung einbauen. Das Problem war bei mir wie bei vielen auch, dass man in LibreOffice nicht sieht, ob ein Tag in der XML-Struktur zerfallen ist (und damit von Dolibarr nicht erkannt und ersetzt wird) oder in Ordnung ist. Da mich das ziemlich genervt hat, habe ich mir ein entsprechendes Tool geschrieben, das einfach die Vorlage einliest und schaut, welche Tags ok sind und welche nicht. So sind fehler sehr schnell behoben.
Das Ganze ist ein Python-Skript und wird sehr einfach in der Kommandozeile aufgerufen:
python odt-tag-analyzer.py odt-Vorlage.odt
Die Ausgabe ist dann so ähnlich wie hier:
=== Dolibarr ODT Tag Analyse ===
Datei: ET_Invoice_de.odt
Gefundene rohe Tags: 24
Geprüfte komplexe Tags: 24
---- POTENTIELL PROBLEMATISCHE TAGS ----
[1]
RAW: {contact_fullname}
CLEANED: {contact_fullname}
[2]
RAW: {contact_address}
CLEANED: {contact_address}
[3]
RAW: {contact_zip}
CLEANED: {contact_zip}
[4]
RAW: {contact_town}
CLEANED: {contact_town}
[5]
RAW: {contact_country}
CLEANED: {contact_country}
[6]
RAW: {mycompany_zip}
CLEANED: {mycompany_zip}
[7]
RAW: {mycompany_town}
CLEANED: {mycompany_town}
[8]
RAW: {mycompany_country}
CLEANED: {mycompany_country}
[9]
RAW: {mycompany_phone}
CLEANED: {mycompany_phone}
[10]
RAW: {mycompany_email}
CLEANED: {mycompany_email}
[11]
RAW: {mycompany_web}
CLEANED: {mycompany_web}
[12]
RAW: {object_ref}
CLEANED: {object_ref}
[13]
RAW: {company_customercode}
CLEANED: {company_customercode}
[14]
RAW: {object_date_</text:span><text:span text:style-name="T17">locale</text:span><text:span text:style-name="T13">}
CLEANED: {object_date_locale}
...
Bei Tag 14 sieht man hier beispielhaft, dass LibreOffice hier intern aus dem Tag zwei XML-Einträge gemacht hat, womit die Ersetzung natürlich nicht mehr funktioniert.
Mir hat das Tool beim Umzug sehr geholfen - wobei man das sicherlich noch deutlich verbessern könnte. Man könnte das Ganze eventuell auch als Makro in LibreOffice direkt laufen lassen.
Vielleicht hilft es ja dem einen oder anderen ![]()
Viele Grüße,
Christoph




