From 504aab41a1ea8c1ad12c18311cddafb48a50998f Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Wed, 11 Dec 2024 10:31:19 +0100 Subject: [PATCH] 5.0: changes for Tryton 5.0 --- __init__.py | 4 +-- locale/de.po | 2 +- locale/en.po | 2 +- mixin.py | 4 +-- party.py | 26 +++++++++---------- template/Factur-X-1.07.2-extended/invoice.xml | 2 +- template/XRechnung-2.2/XRechnung_credit.xml | 4 +-- template/XRechnung-2.2/XRechnung_invoice.xml | 4 +-- template/XRechnung-2.3/XRechnung_credit.xml | 4 +-- template/XRechnung-2.3/XRechnung_invoice.xml | 4 +-- template/XRechnung-3.0/XRechnung_credit.xml | 4 +-- template/XRechnung-3.0/XRechnung_invoice.xml | 4 +-- tryton.cfg | 1 + view/configuration_form.xml | 2 +- 14 files changed, 34 insertions(+), 33 deletions(-) diff --git a/__init__.py b/__init__.py index a7f7f9c..65bedc4 100644 --- a/__init__.py +++ b/__init__.py @@ -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') diff --git a/locale/de.po b/locale/de.po index aaaa604..ba790f9 100644 --- a/locale/de.po +++ b/locale/de.po @@ -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" diff --git a/locale/en.po b/locale/en.po index b0353ce..95bfadd 100644 --- a/locale/en.po +++ b/locale/en.po @@ -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" diff --git a/mixin.py b/mixin.py index 1e75916..767380f 100644 --- a/mixin.py +++ b/mixin.py @@ -7,8 +7,8 @@ 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 diff --git a/party.py b/party.py index cc020c6..77626ac 100644 --- a/party.py +++ b/party.py @@ -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' @@ -50,15 +62,3 @@ class Party(metaclass=PoolMeta): record.get_xrechnung_route_id() # end Party - - -class PartyConfiguration(metaclass=PoolMeta): - __name__ = 'party.configuration' - - @classmethod - def __setup__(cls): - super(PartyConfiguration, cls).__setup__() - cls.identifier_types.selection.append( - ('edoc_route_id', 'X-Rechnung Route-ID')) - -# end Configuration diff --git a/template/Factur-X-1.07.2-extended/invoice.xml b/template/Factur-X-1.07.2-extended/invoice.xml index 8a7a664..2a7a95f 100644 --- a/template/Factur-X-1.07.2-extended/invoice.xml +++ b/template/Factur-X-1.07.2-extended/invoice.xml @@ -24,7 +24,7 @@ this repository contains the full copyright notices and license terms. --> - ${address.postal_code} + ${address.zip} ${this.quote_text(lines[0])} ${this.quote_text(lines[1])} diff --git a/template/XRechnung-2.2/XRechnung_credit.xml b/template/XRechnung-2.2/XRechnung_credit.xml index f0bf795..1851145 100644 --- a/template/XRechnung-2.2/XRechnung_credit.xml +++ b/template/XRechnung-2.2/XRechnung_credit.xml @@ -59,8 +59,8 @@ - ${this.negate_amount(value.base)} - ${this.negate_amount(value.amount)} + ${this.negate_amount(value.base)} + ${this.negate_amount(value.amount)} ${TaxCategory(value.tax, True)} diff --git a/template/XRechnung-2.2/XRechnung_invoice.xml b/template/XRechnung-2.2/XRechnung_invoice.xml index cf4ee6d..f12fad3 100644 --- a/template/XRechnung-2.2/XRechnung_invoice.xml +++ b/template/XRechnung-2.2/XRechnung_invoice.xml @@ -59,8 +59,8 @@ - ${value.base} - ${value.amount} + ${value.base} + ${value.amount} ${TaxCategory(value.tax, True)} diff --git a/template/XRechnung-2.3/XRechnung_credit.xml b/template/XRechnung-2.3/XRechnung_credit.xml index 4ad9ccc..f00caa4 100644 --- a/template/XRechnung-2.3/XRechnung_credit.xml +++ b/template/XRechnung-2.3/XRechnung_credit.xml @@ -59,8 +59,8 @@ - ${this.negate_amount(value.base)} - ${this.negate_amount(value.amount)} + ${this.negate_amount(value.base)} + ${this.negate_amount(value.amount)} ${TaxCategory(value.tax, True)} diff --git a/template/XRechnung-2.3/XRechnung_invoice.xml b/template/XRechnung-2.3/XRechnung_invoice.xml index 517b6e4..f347217 100644 --- a/template/XRechnung-2.3/XRechnung_invoice.xml +++ b/template/XRechnung-2.3/XRechnung_invoice.xml @@ -59,8 +59,8 @@ - ${value.base} - ${value.amount} + ${value.base} + ${value.amount} ${TaxCategory(value.tax, True)} diff --git a/template/XRechnung-3.0/XRechnung_credit.xml b/template/XRechnung-3.0/XRechnung_credit.xml index 102d85b..77cfb73 100644 --- a/template/XRechnung-3.0/XRechnung_credit.xml +++ b/template/XRechnung-3.0/XRechnung_credit.xml @@ -59,8 +59,8 @@ - ${this.negate_amount(value.base)} - ${this.negate_amount(value.amount)} + ${this.negate_amount(value.base)} + ${this.negate_amount(value.amount)} ${TaxCategory(value.tax, True)} diff --git a/template/XRechnung-3.0/XRechnung_invoice.xml b/template/XRechnung-3.0/XRechnung_invoice.xml index 9108504..cf09403 100644 --- a/template/XRechnung-3.0/XRechnung_invoice.xml +++ b/template/XRechnung-3.0/XRechnung_invoice.xml @@ -59,8 +59,8 @@ - ${value.base} - ${value.amount} + ${value.base} + ${value.amount} ${TaxCategory(value.tax, True)} diff --git a/tryton.cfg b/tryton.cfg index 5f68586..5eb9b3b 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -5,6 +5,7 @@ depends: party bank account_invoice + tryton6_backport xml: message.xml configuration.xml diff --git a/view/configuration_form.xml b/view/configuration_form.xml index da9651b..fce2599 100644 --- a/view/configuration_form.xml +++ b/view/configuration_form.xml @@ -4,7 +4,7 @@ full copyright notices and license terms. --> - +