export ok

This commit is contained in:
Frederik Jaeckel 2022-10-20 14:43:58 +02:00
parent 00dd70e877
commit 73e30e1a88
12 changed files with 461 additions and 25 deletions

View file

@ -3,3 +3,4 @@ build/*
dist/* dist/*
mds_account_invoice_xrechnung.egg-info/* mds_account_invoice_xrechnung.egg-info/*
__pycache__/* __pycache__/*
locale/convert_de2en.py

View file

@ -6,6 +6,7 @@
from trytond.pool import Pool from trytond.pool import Pool
from .wizard_runreport import RunXRechnungReport, RunXRechnungReportStart from .wizard_runreport import RunXRechnungReport, RunXRechnungReportStart
from .invoice import InvoiceLine from .invoice import InvoiceLine
from .xreport import XReport
def register(): def register():
Pool.register( Pool.register(
@ -15,3 +16,6 @@ def register():
Pool.register( Pool.register(
RunXRechnungReport, RunXRechnungReport,
module='account_invoice_xrechnung', type_='wizard') module='account_invoice_xrechnung', type_='wizard')
Pool.register(
XReport,
module='account_invoice_xrechnung', type_='report')

59
locale/de.po Normal file
View file

@ -0,0 +1,59 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
#############
# ir.action #
#############
msgctxt "model:ir.action,name:act_wizard_report"
msgid "eDocument Export"
msgstr "eDocument Export"
msgctxt "model:ir.action,name:report_edocument"
msgid "eDocument Export"
msgstr "eDocument Export"
##########################################
# account_invoice_xrechnung.runrep.start #
##########################################
msgctxt "model:account_invoice_xrechnung.runrep.start,name:"
msgid "eDocument Export"
msgstr "eDocument Export"
msgctxt "field:account_invoice_xrechnung.runrep.start,invoice:"
msgid "Invoice"
msgstr "Rechnung"
msgctxt "field:account_invoice_xrechnung.runrep.start,edocument:"
msgid "Type"
msgstr "Typ"
msgctxt "field:account_invoice_xrechnung.runrep.start,as_zip:"
msgid "ZIP-File"
msgstr "ZIP-Datei"
####################################
# account_invoice_xrechnung.runrep #
####################################
msgctxt "model:account_invoice_xrechnung.runrep,name:"
msgid "eDocument Export"
msgstr "eDocument Export"
msgctxt "wizard_button:account_invoice_xrechnung.runrep,start,end:"
msgid "Cancel"
msgstr "Abbruch"
msgctxt "wizard_button:account_invoice_xrechnung.runrep,start,export:"
msgid "Export"
msgstr "Export"
####################################
# account_invoice_xrechnung.export #
####################################
msgctxt "model:account_invoice_xrechnung.export,name:"
msgid "eDocument Export"
msgstr "eDocument Export"

36
locale/en.po Normal file
View file

@ -0,0 +1,36 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "model:ir.action,name:act_wizard_report"
msgid "eDocument Export"
msgstr "eDocument Export"
msgctxt "model:ir.action,name:report_edocument"
msgid "eDocument Export"
msgstr "eDocument Export"
msgctxt "model:account_invoice_xrechnung.runrep.start,name:"
msgid "eDocument Export"
msgstr "eDocument Export"
msgctxt "field:account_invoice_xrechnung.runrep.start,invoice:"
msgid "Invoice"
msgstr "Invoice"
msgctxt "field:account_invoice_xrechnung.runrep.start,edocument:"
msgid "Type"
msgstr "Type"
msgctxt "model:account_invoice_xrechnung.runrep,name:"
msgid "eDocument Export"
msgstr "eDocument Export"
msgctxt "wizard_button:account_invoice_xrechnung.runrep,start,end:"
msgid "Cancel"
msgstr "Cancel"
msgctxt "wizard_button:account_invoice_xrechnung.runrep,start,export:"
msgid "Export"
msgstr "Export"

251
report/export.fodt Normal file
View file

@ -0,0 +1,251 @@
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
<office:meta><meta:creation-date>2017-10-20T23:40:51.940000000</meta:creation-date><meta:generator>LibreOffice/6.0.7.3$Linux_X86_64 LibreOffice_project/00m0$Build-3</meta:generator><meta:editing-cycles>0</meta:editing-cycles><meta:editing-duration>P0D</meta:editing-duration><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="1" meta:word-count="5" meta:character-count="20" meta:non-whitespace-character-count="16"/></office:meta>
<office:settings>
<config:config-item-set config:name="ooo:view-settings">
<config:config-item config:name="ViewAreaTop" config:type="long">0</config:config-item>
<config:config-item config:name="ViewAreaLeft" config:type="long">0</config:config-item>
<config:config-item config:name="ViewAreaWidth" config:type="long">25058</config:config-item>
<config:config-item config:name="ViewAreaHeight" config:type="long">20851</config:config-item>
<config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item>
<config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item>
<config:config-item-map-indexed config:name="Views">
<config:config-item-map-entry>
<config:config-item config:name="ViewId" config:type="string">view2</config:config-item>
<config:config-item config:name="ViewLeft" config:type="long">6720</config:config-item>
<config:config-item config:name="ViewTop" config:type="long">2501</config:config-item>
<config:config-item config:name="VisibleLeft" config:type="long">0</config:config-item>
<config:config-item config:name="VisibleTop" config:type="long">0</config:config-item>
<config:config-item config:name="VisibleRight" config:type="long">25056</config:config-item>
<config:config-item config:name="VisibleBottom" config:type="long">20849</config:config-item>
<config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
<config:config-item config:name="ViewLayoutColumns" config:type="short">1</config:config-item>
<config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item>
<config:config-item config:name="ZoomFactor" config:type="short">100</config:config-item>
<config:config-item config:name="IsSelectedFrame" config:type="boolean">false</config:config-item>
<config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item>
</config:config-item-map-entry>
</config:config-item-map-indexed>
</config:config-item-set>
<config:config-item-set config:name="ooo:configuration-settings">
<config:config-item config:name="PrintPaperFromSetup" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintFaxName" config:type="string"/>
<config:config-item config:name="PrintSingleJobs" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintProspectRTL" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintProspect" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintReversed" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintTextPlaceholder" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintTables" config:type="boolean">true</config:config-item>
<config:config-item config:name="DoNotJustifyLinesWithManualBreak" config:type="boolean">false</config:config-item>
<config:config-item config:name="AlignTabStopPosition" config:type="boolean">true</config:config-item>
<config:config-item config:name="PrintLeftPages" config:type="boolean">true</config:config-item>
<config:config-item config:name="IgnoreFirstLineIndentInNumbering" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
<config:config-item config:name="CollapseEmptyCellPara" config:type="boolean">true</config:config-item>
<config:config-item config:name="RedlineProtectionKey" config:type="base64Binary"/>
<config:config-item config:name="UseOldPrinterMetrics" config:type="boolean">false</config:config-item>
<config:config-item config:name="UseOldNumbering" config:type="boolean">false</config:config-item>
<config:config-item config:name="AddExternalLeading" config:type="boolean">true</config:config-item>
<config:config-item config:name="TreatSingleColumnBreakAsPageBreak" config:type="boolean">false</config:config-item>
<config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item>
<config:config-item config:name="IsLabelDocument" config:type="boolean">false</config:config-item>
<config:config-item config:name="RsidRoot" config:type="int">3071</config:config-item>
<config:config-item config:name="ConsiderTextWrapOnObjPos" config:type="boolean">false</config:config-item>
<config:config-item config:name="TableRowKeep" config:type="boolean">false</config:config-item>
<config:config-item config:name="TabsRelativeToIndent" config:type="boolean">true</config:config-item>
<config:config-item config:name="SaveVersionOnClose" config:type="boolean">false</config:config-item>
<config:config-item config:name="UseFormerTextWrapping" config:type="boolean">false</config:config-item>
<config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item>
<config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item>
<config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item>
<config:config-item config:name="AddParaTableSpacing" config:type="boolean">true</config:config-item>
<config:config-item config:name="PrintDrawings" config:type="boolean">true</config:config-item>
<config:config-item config:name="AddParaSpacingToTableCells" config:type="boolean">true</config:config-item>
<config:config-item config:name="UseFormerLineSpacing" config:type="boolean">false</config:config-item>
<config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item>
<config:config-item config:name="LinkUpdateMode" config:type="short">1</config:config-item>
<config:config-item config:name="DoNotResetParaAttrsForNumFont" config:type="boolean">false</config:config-item>
<config:config-item config:name="ApplyUserData" config:type="boolean">false</config:config-item>
<config:config-item config:name="StylesNoDefault" config:type="boolean">false</config:config-item>
<config:config-item config:name="EmbeddedDatabaseName" config:type="string"/>
<config:config-item config:name="FloattableNomargins" config:type="boolean">false</config:config-item>
<config:config-item config:name="BackgroundParaOverDrawings" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrinterName" config:type="string"/>
<config:config-item config:name="UseFormerObjectPositioning" config:type="boolean">false</config:config-item>
<config:config-item config:name="TabOverMargin" config:type="boolean">false</config:config-item>
<config:config-item config:name="SaveGlobalDocumentLinks" config:type="boolean">false</config:config-item>
<config:config-item config:name="CurrentDatabaseDataSource" config:type="string"/>
<config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item>
<config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item>
<config:config-item config:name="SmallCapsPercentage66" config:type="boolean">false</config:config-item>
<config:config-item config:name="CurrentDatabaseCommand" config:type="string"/>
<config:config-item config:name="CurrentDatabaseCommandType" config:type="int">0</config:config-item>
<config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item>
<config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" config:type="boolean">false</config:config-item>
<config:config-item config:name="LoadReadonly" config:type="boolean">true</config:config-item>
<config:config-item config:name="DoNotCaptureDrawObjsOnPage" config:type="boolean">false</config:config-item>
<config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintBlackFonts" config:type="boolean">false</config:config-item>
<config:config-item config:name="DisableOffPagePositioning" config:type="boolean">true</config:config-item>
<config:config-item config:name="SurroundTextWrapSmall" config:type="boolean">false</config:config-item>
<config:config-item config:name="UnxForceZeroExtLeading" config:type="boolean">false</config:config-item>
<config:config-item config:name="TabAtLeftIndentForParagraphsInList" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintRightPages" config:type="boolean">true</config:config-item>
<config:config-item config:name="Rsid" config:type="int">20402</config:config-item>
<config:config-item config:name="MathBaselineAlignment" config:type="boolean">true</config:config-item>
<config:config-item config:name="MsWordCompTrailingBlanks" config:type="boolean">false</config:config-item>
<config:config-item config:name="InvertBorderSpacing" config:type="boolean">false</config:config-item>
<config:config-item config:name="EmbedFonts" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrinterIndependentLayout" config:type="string">high-resolution</config:config-item>
<config:config-item config:name="TabOverflow" config:type="boolean">true</config:config-item>
<config:config-item config:name="PrintGraphics" config:type="boolean">true</config:config-item>
<config:config-item config:name="PropLineSpacingShrinksFirstLine" config:type="boolean">true</config:config-item>
<config:config-item config:name="UnbreakableNumberings" config:type="boolean">false</config:config-item>
<config:config-item config:name="AddFrameOffsets" config:type="boolean">false</config:config-item>
<config:config-item config:name="ClippedPictures" config:type="boolean">false</config:config-item>
<config:config-item config:name="EmbedSystemFonts" config:type="boolean">false</config:config-item>
<config:config-item config:name="ApplyParagraphMarkFormatToNumbering" config:type="boolean">false</config:config-item>
<config:config-item config:name="SubtractFlysAnchoredAtFlys" config:type="boolean">false</config:config-item>
<config:config-item config:name="AddVerticalFrameOffsets" config:type="boolean">false</config:config-item>
<config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintEmptyPages" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintControls" config:type="boolean">true</config:config-item>
<config:config-item config:name="PrintHiddenText" config:type="boolean">false</config:config-item>
<config:config-item config:name="PrintAnnotationMode" config:type="short">0</config:config-item>
<config:config-item config:name="PrintPageBackground" config:type="boolean">true</config:config-item>
</config:config-item-set>
</office:settings>
<office:scripts>
<office:script script:language="ooo:Basic">
<ooo:libraries xmlns:ooo="http://openoffice.org/2004/office" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</office:script>
</office:scripts>
<office:font-face-decls>
<style:font-face style:name="Mangal1" svg:font-family="Mangal"/>
<style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
<style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
<style:font-face style:name="Mangal" svg:font-family="Mangal" style:font-family-generic="system" style:font-pitch="variable"/>
<style:font-face style:name="Microsoft YaHei" svg:font-family="&apos;Microsoft YaHei&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
<style:font-face style:name="SimSun" svg:font-family="SimSun" style:font-family-generic="system" style:font-pitch="variable"/>
</office:font-face-decls>
<office:styles>
<style:default-style style:family="graphic">
<style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
<style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false">
<style:tab-stops/>
</style:paragraph-properties>
<style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="SimSun" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Mangal" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
</style:default-style>
<style:default-style style:family="paragraph">
<style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
<style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="SimSun" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Mangal" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
</style:default-style>
<style:default-style style:family="table">
<style:table-properties table:border-model="collapsing"/>
</style:default-style>
<style:default-style style:family="table-row">
<style:table-row-properties fo:keep-together="auto"/>
</style:default-style>
<style:style style:name="Standard" style:family="paragraph" style:class="text"/>
<style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
<style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" loext:contextual-spacing="false" fo:keep-with-next="always"/>
<style:text-properties style:font-name="Liberation Sans" fo:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable" fo:font-size="14pt" style:font-name-asian="Microsoft YaHei" style:font-family-asian="&apos;Microsoft YaHei&apos;" style:font-family-generic-asian="system" style:font-pitch-asian="variable" style:font-size-asian="14pt" style:font-name-complex="Mangal" style:font-family-complex="Mangal" style:font-family-generic-complex="system" style:font-pitch-complex="variable" style:font-size-complex="14pt"/>
</style:style>
<style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.247cm" loext:contextual-spacing="false" fo:line-height="120%"/>
</style:style>
<style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list">
<style:text-properties style:font-size-asian="12pt" style:font-name-complex="Mangal1" style:font-family-complex="Mangal"/>
</style:style>
<style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
<style:paragraph-properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm" loext:contextual-spacing="false" text:number-lines="false" text:line-number="0"/>
<style:text-properties fo:font-size="12pt" fo:font-style="italic" style:font-size-asian="12pt" style:font-style-asian="italic" style:font-name-complex="Mangal1" style:font-family-complex="Mangal" style:font-size-complex="12pt" style:font-style-complex="italic"/>
</style:style>
<style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard" style:class="index">
<style:paragraph-properties text:number-lines="false" text:line-number="0"/>
<style:text-properties style:font-size-asian="12pt" style:font-name-complex="Mangal1" style:font-family-complex="Mangal"/>
</style:style>
<text:outline-style style:name="Outline">
<text:outline-level-style text:level="1" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
<text:outline-level-style text:level="2" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
<text:outline-level-style text:level="3" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
<text:outline-level-style text:level="4" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
<text:outline-level-style text:level="5" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
<text:outline-level-style text:level="6" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
<text:outline-level-style text:level="7" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
<text:outline-level-style text:level="8" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
<text:outline-level-style text:level="9" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
<text:outline-level-style text:level="10" style:num-format="">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab"/>
</style:list-level-properties>
</text:outline-level-style>
</text:outline-style>
<text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
<text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
<text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
</office:styles>
<office:automatic-styles>
<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
<style:text-properties officeooo:rsid="00004fb2" officeooo:paragraph-rsid="00004fb2"/>
</style:style>
<style:page-layout style:name="pm1">
<style:page-layout-properties fo:page-width="21.59cm" fo:page-height="27.94cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm">
<style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
</style:page-layout-properties>
<style:header-style/>
<style:footer-style/>
</style:page-layout>
</office:automatic-styles>
<office:master-styles>
<style:master-page style:name="Standard" style:page-layout-name="pm1"/>
</office:master-styles>
<office:body>
<office:text>
<text:sequence-decls>
<text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
</text:sequence-decls>
<text:p text:style-name="P1">file is not used :-)</text:p>
</office:text>
</office:body>
</office:document>

View file

@ -42,7 +42,7 @@ with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f:
major_version = 6 major_version = 6
minor_version = 0 minor_version = 0
requires = [] requires = ['python-slugify']
for dep in info.get('depends', []): for dep in info.get('depends', []):
if not re.match(r'(ir|res|webdav)(\W|$)', dep): if not re.match(r'(ir|res|webdav)(\W|$)', dep):
if dep in modversion.keys(): if dep in modversion.keys():
@ -89,7 +89,7 @@ setup(name='%s_%s' % (PREFIX, MODULE),
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
], ],
keywords='tryton account invoice xrechnung', keywords='tryton account invoice xrechnung edocument',
package_dir={'trytond.modules.%s' % MODULE: '.'}, package_dir={'trytond.modules.%s' % MODULE: '.'},
packages=[ packages=[
'trytond.modules.%s' % MODULE, 'trytond.modules.%s' % MODULE,

View file

@ -6,3 +6,4 @@ depends:
edocument_xrechnung edocument_xrechnung
xml: xml:
wizard_runreport.xml wizard_runreport.xml
xreport.xml

View file

@ -8,4 +8,7 @@ full copyright notices and license terms. -->
<label name="edocument"/> <label name="edocument"/>
<field name="edocument"/> <field name="edocument"/>
<label name="as_zip"/>
<field name="as_zip"/>
</form> </form>

View file

@ -4,7 +4,7 @@
# full copyright notices and license terms. # full copyright notices and license terms.
from trytond.model import ModelView, fields from trytond.model import ModelView, fields
from trytond.wizard import Wizard, StateView, StateReport from trytond.wizard import Wizard, StateView, StateReport, Button
from trytond.pool import Pool from trytond.pool import Pool
from trytond.transaction import Transaction from trytond.transaction import Transaction
@ -14,15 +14,28 @@ sel_edocument = [
('edocument.uncefact.invoice', 'CII CrossIndustryInvoice D16B'), ('edocument.uncefact.invoice', 'CII CrossIndustryInvoice D16B'),
] ]
edoc_versions = {
'edocument.xrechnung.invoice': 'XRechnung-2.2',
'edocument.uncefact.invoice': '16B-CII',
}
class RunXRechnungReportStart(ModelView): class RunXRechnungReportStart(ModelView):
'eDocument Report' 'eDocument Export'
__name__ = 'account_invoice_xrechnung.runrep.start' __name__ = 'account_invoice_xrechnung.runrep.start'
invoice = fields.Many2One(string='Invoice', readonly=True, invoice = fields.Many2One(string='Invoice', readonly=True,
model_name='account.invoice', required=True) model_name='account.invoice', required=True)
edocument = fields.Selection(string='eDocument', required=True, edocument = fields.Selection(string='Type', required=True,
selection=sel_edocument) selection=sel_edocument)
as_zip = fields.Boolean(string='ZIP-File')
@classmethod
def default_as_zip(cls):
""" default: True
"""
return True
@classmethod @classmethod
def default_edocument(cls): def default_edocument(cls):
@ -34,21 +47,21 @@ class RunXRechnungReportStart(ModelView):
class RunXRechnungReport(Wizard): class RunXRechnungReport(Wizard):
'eDocument Report' 'eDocument Export'
__name__ = 'account_invoice_xrechnung.runrep' __name__ = 'account_invoice_xrechnung.runrep'
start_state = 'open_' start_state = 'start'
export = StateReport('account_invoice_xrechnung.export') export = StateReport('account_invoice_xrechnung.export')
open_ = StateView( start = StateView(
model_name='account_invoice_xrechnung.runrep.start', model_name='account_invoice_xrechnung.runrep.start',
view='account_invoice_xrechnung.wiz_start_form', view='account_invoice_xrechnung.wiz_start_form',
buttons=[ buttons=[
Button(string='Cancel', state='cleanup', icon='tryton-cancel'), Button(string='Cancel', state='end', icon='tryton-cancel'),
Button(string='Export', state='export', icon='tryton-export'), Button(string='Export', state='export', icon='tryton-export'),
], ],
) )
def default_open_(self): def default_start(self, fields):
""" set defaults """ set defaults
""" """
context = Transaction().context context = Transaction().context
@ -60,20 +73,12 @@ class RunXRechnungReport(Wizard):
return result return result
def do_export(self, action): def do_export(self, action):
""" run form """ run export
""" """
pool = Pool() return action, {
Invoice = pool.get('account.invoice') 'invoice': self.start.invoice.id,
EDocument = pool.get('edocument.xrechnung.invoice') 'edocument': self.start.edocument,
context = Transaction().context 'as_zip': self.start.as_zip,
}
invoice, = Invoice.browse([context.get('active_id', -1)])
template = EDocument(invoice)
invoice_string = template.render('XRechnung-2.2')
print('\n## invoice_string:', invoice_string.decode('utf8'))
with open('x-rechnung.xml', 'wt') as fhdl:
fhdl.write(invoice_string.decode('utf8'))
return action, {}
# end RunXRechnungReport # end RunXRechnungReport

View file

@ -13,7 +13,7 @@ full copyright notices and license terms. -->
</record> </record>
<record model="ir.action.wizard" id="act_wizard_report"> <record model="ir.action.wizard" id="act_wizard_report">
<field name="name">XRechnung Report</field> <field name="name">eDocument Export</field>
<field name="wiz_name">account_invoice_xrechnung.runrep</field> <field name="wiz_name">account_invoice_xrechnung.runrep</field>
</record> </record>
<record model="ir.action.keyword" id="wizrecon_line-keyword"> <record model="ir.action.keyword" id="wizrecon_line-keyword">

58
xreport.py Normal file
View file

@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
# This file is part of the cashbook-module from m-ds for Tryton.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
import zipfile
from io import BytesIO
from trytond.report import Report
from trytond.pool import Pool
from slugify import slugify
from .wizard_runreport import edoc_versions
class XReport(Report):
'eDocument Export'
__name__ = 'account_invoice_xrechnung.export'
@classmethod
def compress_as_zip(cls, fname, data):
""" compress
"""
content = BytesIO()
with zipfile.ZipFile(content, 'w') as content_zip:
content_zip.writestr(fname, data)
return content.getvalue()
@classmethod
def execute(cls, ids, data):
""" skip export-engine, run edocument-xml-convert
"""
pool = Pool()
IrDate = pool.get('ir.date')
Invoice = pool.get('account.invoice')
EDocument = pool.get(data['edocument'])
invoice, = Invoice.browse([data['invoice']])
template = EDocument(invoice)
invoice_string = template.render(edoc_versions[data['edocument']])
file_name = slugify('%(date)s-%(descr)s' % {
'date': IrDate.today().isoformat().replace('-', ''),
'descr': invoice.rec_name,
},
max_length=100, word_boundary=True, save_order=True)
if data['as_zip'] == True:
return (
'zip',
cls.compress_as_zip('%(fname)s.%(ext)s' % {
'fname': file_name,
'ext': 'xml',
}, invoice_string),
False,
file_name)
else :
return ('xml', invoice_string, False, file_name)
# end XReport

18
xreport.xml Normal file
View file

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!-- This file is part of the cashbook-module from m-ds for Tryton.
The COPYRIGHT file at the top level of this repository contains the
full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.action.report" id="report_edocument">
<field name="name">eDocument Export</field>
<field name="model">account.invoice</field>
<field name="report_name">account_invoice_xrechnung.export</field>
<field name="report">account_invoice_xrechnung/report/export.fodt</field>
<field name="template_extension">odt</field>
<field name="single" eval="True"/>
</record>
</data>
</tryton>