Compare commits

...

53 commits
main ... 5.0

Author SHA1 Message Date
Frederik Jaeckel
cf396d368f Version 5.0.14 2025-01-29 10:02:02 +01:00
Frederik Jaeckel
2cfdf25d7b add price_digits() to mixin.py 2025-01-29 10:01:05 +01:00
Frederik Jaeckel
f944b9019c Merge branch 'main' into 5.0 2025-01-29 09:56:59 +01:00
Frederik Jaeckel
a7a3e55900 Version 5.0.13 2025-01-28 13:57:54 +01:00
Frederik Jaeckel
430732d3ec fix merge 2025-01-28 13:40:29 +01:00
Frederik Jaeckel
f79b186870 Merge branch 'main' into 5.0 2025-01-28 13:25:58 +01:00
Frederik Jaeckel
9513e17685 Version 5.0.11 2024-12-19 12:12:01 +01:00
Frederik Jaeckel
87ef589854 add docs 2024-12-19 12:08:22 +01:00
Mathias Behrle
5ca6b721eb Improve the help text of xrechnung_routeid. 2024-12-19 12:08:16 +01:00
Mathias Behrle
ddad5e91dd Lookup parent taxes for unece tax codes.
In the same way as for categories the unece tax codes must be searched
on parents.
2024-12-19 12:08:11 +01:00
Mathias Behrle
a374297567 Correct a translation. 2024-12-19 12:08:05 +01:00
Frederik Jaeckel
aed57f807b Version 5.0.10 2024-12-17 14:37:30 +01:00
Frederik Jaeckel
1c8e1f687f add folder 'view' to setup.py 2024-12-17 13:13:29 +01:00
Mathias Behrle
8e1833b205 Remove arguments in super() calls.
They are no more needed in Python3 and usually result in unexpected
behavior when wrongly used (like e.g. the one introduced in
764cacc091 and solved meanwhile by
refactorization).
2024-12-17 13:12:59 +01:00
Frederik Jaeckel
481434b483 Version 5.0.9 2024-12-11 18:05:31 +01:00
Frederik Jaeckel
42990404d3 fix name of party in error message 2024-12-11 17:34:31 +01:00
Frederik Jaeckel
13a3cd12cc changes for Tryton 5.0 2024-12-11 17:34:18 +01:00
Frederik Jaeckel
21b4ae0ca3 Version 5.0.8 2024-12-11 11:37:57 +01:00
Frederik Jaeckel
ec18119853 Version 5.0.7 2024-12-11 10:33:37 +01:00
Frederik Jaeckel
504aab41a1 5.0: changes for Tryton 5.0 2024-12-11 10:31:19 +01:00
Frederik Jaeckel
569b4e2fc8 Version 6.0.7 2024-12-10 15:15:07 +01:00
Frederik Jaeckel
d02ffe5d26 update configuration form 2024-12-10 15:14:57 +01:00
Frederik Jaeckel
a1456cdc76 fix tests 2024-12-10 14:56:44 +01:00
Frederik Jaeckel
816d181d13 fix code 2024-12-10 14:45:44 +01:00
Frederik Jaeckel
bbb0673a71 add bank account number to xml-export 2024-12-10 14:45:40 +01:00
Frederik Jaeckel
a4add36fed fix typo 2024-12-10 14:45:36 +01:00
Frederik Jaeckel
2e96a1d4c9 configuration: add setting for used bank nuumbers 2024-12-10 14:45:32 +01:00
Frederik Jaeckel
5c2d5e2a1d bank accont number: add field 'company_owned' 2024-12-10 14:45:15 +01:00
Frederik Jaeckel
fce531c210 doks 2024-12-10 14:44:49 +01:00
Frederik Jaeckel
b2e2b36edd check for valid address data 2024-12-10 14:44:44 +01:00
Frederik Jaeckel
0150aead02 facturx: check unece codes at tax 2024-12-10 14:44:40 +01:00
Frederik Jaeckel
30ad2c5201 update setup.py 2024-12-10 14:44:35 +01:00
Frederik Jaeckel
9c1bf1ca18 export: add factur-x 1.07.2 2024-12-10 14:44:29 +01:00
Frederik Jaeckel
0937e5548b add xsd for factur-x 2024-12-10 14:44:24 +01:00
Frederik Jaeckel
61cf85eb0b allow route-id to be optional 2024-12-10 14:44:11 +01:00
Frederik Jaeckel
004f35ad13 update docs 2024-12-10 14:43:11 +01:00
Frederik Jaeckel
59ef90e198 export: add xrechnung 2.3 + 3.0 + tests against xsd 2024-12-10 14:42:55 +01:00
Frederik Jaeckel
e3a0e730f9 add xsd UBL-2.1 2024-12-10 14:41:25 +01:00
Frederik Jaeckel
95ea673358 add docs 2024-12-10 14:41:21 +01:00
Frederik Jaeckel
fc5c250a20 formatting 2024-12-10 14:41:17 +01:00
Frederik Jaeckel
4c95a412c3 file info 2024-12-10 14:41:13 +01:00
Frederik Jaeckel
227577fb16 update gitignore 2024-12-10 14:41:08 +01:00
Frederik Jaeckel
10a2b61832 update gitignore 2024-12-10 14:40:32 +01:00
Mathias Behrle
cc4dcd73db Lookup parent taxes for unece tax codes.
Child taxes do not respect the setting of the parent 'Override
tmeplate', thus can not be configured for unece codes. It is anyway
better to allow the code definition on the parent tax.
2024-12-10 14:40:27 +01:00
Frederik Jaeckel
41da51562c add license, fix fileinfo 2024-12-10 14:39:37 +01:00
Frederik Jaeckel
2d7adffe35 Etikett ver 6.0.2 zum Änderungssatz 25555411bebe hinzugefügt 2023-06-30 16:01:09 +02:00
Frederik Jaeckel
2a0adb0ebe Version 6.0.2 2023-06-30 16:01:02 +02:00
Frederik Jaeckel
294c3869a6 merge... 2023-06-30 15:58:48 +02:00
Frederik Jaeckel
15dbf83233 formatting 2023-06-30 15:31:47 +02:00
Frederik Jaeckel
c3aadd0dfe add: creditnote 2023-06-30 15:29:51 +02:00
Frederik Jaeckel
7d20e3d091 formatting 2023-06-30 11:36:17 +02:00
Frederik Jaeckel
5bb3af1f39 Etikett ver 6.0.1 zum Änderungssatz 7dad1155b409 hinzugefügt 2022-10-20 14:57:30 +02:00
Frederik Jaeckel
b4e7a97793 Version 6.0.1 2022-10-20 14:57:12 +02:00
19 changed files with 90 additions and 72 deletions

View file

@ -9,37 +9,38 @@ pip install mds-edocument-xrechnung
Requires
========
- Tryton 7.0
- Tryton 5.0
Changes
=======
*7.0.10 - 12.12.2024*
- handle tax childs (Jan Grasnick <jan@mittelwind.de>)
- fix: rounding of unit_price at invoice-line
*5.0.14 - 29.01.2025*
- updt: optimize rounding of unit_price
*5.0.11 - 19.12.2024*
- Lookup parent taxes for unece tax codes.
- Improve the help text of xrechnung_routeid. Correct a translation.
(Mathias Behrle <mathiasb@m9s.biz>)
*5.0.10 - 17.12.2024*
- fix missing views
- Remove arguments in super() calls. (Mathias Behrle)
*7.0.9 - 11.12.2024*
*5.0.9 - 11.12.2024*
- fix name of party in exceptions
*7.0.7 - 10.12.2024*
*5.0.8 - 11.12.2024*
- add iban to xml-export
- fix setup
*7.0.6 - 09.12.2024*
*5.0.7 - 10.12.2024*
- add: check for valid data to generate xml
*7.0.5 - 05.12.2024*
- add: export Factur-X 1.07.2
*7.0.4 - 05.12.2024*
- add: export XRechnung 2.3 + 3.0
- updt: xrechnung-route-id optional
*7.0.3 - 22.12.2023*
- compatibility to Tryton 7.0
- compatibility to Tryton 5.0
- add: export of factur-x 1.07.2, XRechnung 2.3 + 3.0

View file

@ -6,7 +6,7 @@
from trytond.pool import Pool
from .edocument import XRechnung, FacturX
from .bank import AccountNumber
from .party import PartyConfiguration, Party
from .party import Party, PartyIdentifier
from .configuration import Configuration, BankEdocumentRel
@ -18,5 +18,5 @@ def register():
BankEdocumentRel,
FacturX,
Party,
PartyConfiguration,
PartyIdentifier,
module='edocument_xrechnung', type_='model')

View file

@ -46,7 +46,7 @@ msgstr "Für die Adresse der Partei '%(party)s' ist kein Land festgelegt."
#######################
# party.configuration #
#######################
msgctxt "selection:party.configuration,identifier_types:"
msgctxt "selection:party.identifier,type:"
msgid "X-Rechnung Route-ID"
msgstr "X-Rechnung Leitweg-ID"

View file

@ -38,7 +38,7 @@ msgctxt "model:ir.message,text:msg_no_address_country"
msgid "No country is specified for the address of the party '%(party)s'."
msgstr "No country is specified for the address of the party '%(party)s'."
msgctxt "selection:party.configuration,identifier_types:"
msgctxt "selection:party.identifier,type:"
msgid "X-Rechnung Route-ID"
msgstr "X-Rechnung Route-ID"
@ -50,10 +50,6 @@ msgctxt "field:party.party,xrechnung_routeid:"
msgid "X-Rechnung Route-ID"
msgstr "X-Rechnung Route-ID"
msgctxt "help:party.party,xrechnung_routeid:"
msgid "Enables the need for an XRechnung route ID at the party for exporting the XRechnung."
msgstr "Enables the need for an XRechnung route ID at the party for exporting the XRechnung."
msgctxt "field:account.tax,xrtax_category:"
msgid "Tax Category"
msgstr "Tax Category"

View file

@ -7,10 +7,18 @@
from decimal import Decimal
import html
from trytond.exceptions import UserError
from trytond.i18n import gettext
from trytond.tools import cached_property
from trytond.modules.tryton6_backport.i18n import gettext
from cached_property import cached_property
from trytond.pool import Pool
from trytond.modules.product import round_price
from trytond.modules.product import price_digits
def round_price(value, rounding=None):
"Round price using the price digits"
if isinstance(value, int):
return Decimal(value)
return value.quantize(
Decimal(1) / 10 ** price_digits[1], rounding=rounding)
class EdocumentMixin(object):

View file

@ -5,10 +5,22 @@
from trytond.pool import PoolMeta
from trytond.exceptions import UserError
from trytond.i18n import gettext
from trytond.modules.tryton6_backport.i18n import gettext
from trytond.model import fields
class PartyIdentifier(metaclass=PoolMeta):
__name__ = 'party.identifier'
@classmethod
def __setup__(cls):
super(PartyIdentifier, cls).__setup__()
cls.type.selection.append(
('edoc_route_id', 'X-Rechnung Route-ID'))
# end PartyIdentifier
class Party(metaclass=PoolMeta):
__name__ = 'party.party'
@ -52,15 +64,3 @@ class Party(metaclass=PoolMeta):
record.get_xrechnung_route_id()
# end Party
class PartyConfiguration(metaclass=PoolMeta):
__name__ = 'party.configuration'
@classmethod
def __setup__(cls):
super().__setup__()
cls.identifier_types.selection.append(
('edoc_route_id', 'X-Rechnung Route-ID'))
# end Configuration

View file

@ -36,7 +36,7 @@ with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f:
modversion[l2[0]] = {'min': l2[1], 'max': l2[2], 'prefix': l2[3]}
# tryton-version
major_version = 7
major_version = 5
minor_version = 0
requires = []
@ -84,6 +84,8 @@ setup(
'Natural Language :: English',
'Operating System :: OS Independent',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',

View file

@ -24,7 +24,7 @@ this repository contains the full copyright notices and license terms. -->
</ram:SpecifiedTaxRegistration>
</py:def>
<py:def function="TradeAddress(address)">
<ram:PostcodeCode py:if="address.postal_code">${address.postal_code}</ram:PostcodeCode>
<ram:PostcodeCode py:if="address.zip">${address.zip}</ram:PostcodeCode>
<py:with vars="lines = (address.street or '').splitlines()">
<ram:LineOne py:if="len(lines) > 0">${this.quote_text(lines[0])}</ram:LineOne>
<ram:LineTwo py:if="len(lines) > 1">${this.quote_text(lines[1])}</ram:LineTwo>

View file

@ -59,8 +59,8 @@
<py:def function="TaxSubTotal(value)">
<cac:TaxSubtotal>
<cbc:TaxableAmount py:attrs="{'currencyID': value.currency.code}">${this.negate_amount(value.base)}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.currency.code}">${this.negate_amount(value.amount)}</cbc:TaxAmount>
<cbc:TaxableAmount py:attrs="{'currencyID': value.invoice.currency.code}">${this.negate_amount(value.base)}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.invoice.currency.code}">${this.negate_amount(value.amount)}</cbc:TaxAmount>
<cac:TaxCategory>
${TaxCategory(value.tax, True)}
</cac:TaxCategory>

View file

@ -59,8 +59,8 @@
<py:def function="TaxSubTotal(value)">
<cac:TaxSubtotal>
<cbc:TaxableAmount py:attrs="{'currencyID': value.currency.code}">${value.base}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.currency.code}">${value.amount}</cbc:TaxAmount>
<cbc:TaxableAmount py:attrs="{'currencyID': value.invoice.currency.code}">${value.base}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.invoice.currency.code}">${value.amount}</cbc:TaxAmount>
<cac:TaxCategory>
${TaxCategory(value.tax, True)}
</cac:TaxCategory>
@ -90,7 +90,7 @@
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.1</cbc:CustomizationID>
<cbc:ID>${this.invoice.number}</cbc:ID>
<cbc:IssueDate>${this.invoice.invoice_date.isoformat()}</cbc:IssueDate>
<cbc:DueDate>${(this.invoice.payment_term_date or this.invoice.invoice_date).isoformat()}</cbc:DueDate>
<cbc:DueDate>${this.invoice.invoice_date.isoformat()}</cbc:DueDate>
<cbc:InvoiceTypeCode>${this.type_code}</cbc:InvoiceTypeCode>
<cbc:Note py:if="this.invoice_note()">${this.invoice_note()}</cbc:Note>
<cbc:DocumentCurrencyCode>${this.invoice.currency.code}</cbc:DocumentCurrencyCode>

View file

@ -59,8 +59,8 @@
<py:def function="TaxSubTotal(value)">
<cac:TaxSubtotal>
<cbc:TaxableAmount py:attrs="{'currencyID': value.currency.code}">${this.negate_amount(value.base)}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.currency.code}">${this.negate_amount(value.amount)}</cbc:TaxAmount>
<cbc:TaxableAmount py:attrs="{'currencyID': value.invoice.currency.code}">${this.negate_amount(value.base)}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.invoice.currency.code}">${this.negate_amount(value.amount)}</cbc:TaxAmount>
<cac:TaxCategory>
${TaxCategory(value.tax, True)}
</cac:TaxCategory>

View file

@ -59,8 +59,8 @@
<py:def function="TaxSubTotal(value)">
<cac:TaxSubtotal>
<cbc:TaxableAmount py:attrs="{'currencyID': value.currency.code}">${value.base}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.currency.code}">${value.amount}</cbc:TaxAmount>
<cbc:TaxableAmount py:attrs="{'currencyID': value.invoice.currency.code}">${value.base}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.invoice.currency.code}">${value.amount}</cbc:TaxAmount>
<cac:TaxCategory>
${TaxCategory(value.tax, True)}
</cac:TaxCategory>
@ -90,7 +90,7 @@
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3</cbc:CustomizationID>
<cbc:ID>${this.invoice.number}</cbc:ID>
<cbc:IssueDate>${this.invoice.invoice_date.isoformat()}</cbc:IssueDate>
<cbc:DueDate>${(this.invoice.payment_term_date or this.invoice.invoice_date).isoformat()}</cbc:DueDate>
<cbc:DueDate>${this.invoice.invoice_date.isoformat()}</cbc:DueDate>
<cbc:InvoiceTypeCode>${this.type_code}</cbc:InvoiceTypeCode>
<cbc:Note py:if="this.invoice_note()">${this.invoice_note()}</cbc:Note>
<cbc:DocumentCurrencyCode>${this.invoice.currency.code}</cbc:DocumentCurrencyCode>

View file

@ -59,8 +59,8 @@
<py:def function="TaxSubTotal(value)">
<cac:TaxSubtotal>
<cbc:TaxableAmount py:attrs="{'currencyID': value.currency.code}">${this.negate_amount(value.base)}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.currency.code}">${this.negate_amount(value.amount)}</cbc:TaxAmount>
<cbc:TaxableAmount py:attrs="{'currencyID': value.invoice.currency.code}">${this.negate_amount(value.base)}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.invoice.currency.code}">${this.negate_amount(value.amount)}</cbc:TaxAmount>
<cac:TaxCategory>
${TaxCategory(value.tax, True)}
</cac:TaxCategory>

View file

@ -59,8 +59,8 @@
<py:def function="TaxSubTotal(value)">
<cac:TaxSubtotal>
<cbc:TaxableAmount py:attrs="{'currencyID': value.currency.code}">${value.base}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.currency.code}">${value.amount}</cbc:TaxAmount>
<cbc:TaxableAmount py:attrs="{'currencyID': value.invoice.currency.code}">${value.base}</cbc:TaxableAmount>
<cbc:TaxAmount py:attrs="{'currencyID': value.invoice.currency.code}">${value.amount}</cbc:TaxAmount>
<cac:TaxCategory>
${TaxCategory(value.tax, True)}
</cac:TaxCategory>
@ -90,7 +90,7 @@
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_3.0</cbc:CustomizationID>
<cbc:ID>${this.invoice.number}</cbc:ID>
<cbc:IssueDate>${this.invoice.invoice_date.isoformat()}</cbc:IssueDate>
<cbc:DueDate>${(this.invoice.payment_term_date or this.invoice.invoice_date).isoformat()}</cbc:DueDate>
<cbc:DueDate>${this.invoice.invoice_date.isoformat()}</cbc:DueDate>
<cbc:InvoiceTypeCode>${this.type_code}</cbc:InvoiceTypeCode>
<cbc:Note py:if="this.invoice_note()">${this.invoice_note()}</cbc:Note>
<cbc:DocumentCurrencyCode>${this.invoice.currency.code}</cbc:DocumentCurrencyCode>

View file

@ -2,3 +2,17 @@
# This file is part of the edocument-module for Tryton from m-ds.de.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
import trytond.tests.test_tryton
import unittest
from .test_edocument import EdocTestCase
__all__ = ['suite']
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
EdocTestCase))
return suite

View file

@ -17,15 +17,10 @@ from trytond.exceptions import UserError
def set_invoice_sequences(fiscalyear):
pool = Pool()
Sequence = pool.get('ir.sequence.strict')
SequenceType = pool.get('ir.sequence.type')
InvoiceSequence = pool.get('account.fiscalyear.invoice_sequence')
ModelData = pool.get('ir.model.data')
sequence = Sequence(
name=fiscalyear.name,
sequence_type=SequenceType(ModelData.get_id(
'account_invoice', 'sequence_type_account_invoice')),
company=fiscalyear.company)
sequence = Sequence(name=fiscalyear.name, code='account.invoice')
sequence.company = fiscalyear.company
sequence.save()
fiscalyear.invoice_sequences = []
invoice_sequence = InvoiceSequence()
@ -105,7 +100,7 @@ class EdocTestCase(ModuleTestCase):
'addresses': [('create', [{
'invoice': True,
'street': 'Customer Street 1',
'postal_code': '12345',
'zip': '12345',
'city': 'Usertown',
'country': country_de.id,
}])],

View file

@ -1,10 +1,11 @@
[tryton]
version=7.0.10
version=5.0.14
depends:
edocument_uncefact
party
bank
account_invoice
tryton6_backport
xml:
message.xml
configuration.xml

View file

@ -1 +1,2 @@
tryton6_backport;5.0.3;5.0.999;mds
edocument_uncefact;5.0.6;5.0.999;mds

View file

@ -4,7 +4,7 @@
full copyright notices and license terms. -->
<data>
<xpath expr="/form/separator[@id='currency_exchange']" position="before">
<xpath expr="/form/separator[@id='invoice']" position="before">
<separator id="edocument" colspan="4" string="eDocument"/>
<field name="edocument_bank" colspan="2" height="200"/>