From 659e78a68656661489876587446ad230ce8a7c9b Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Thu, 19 Dec 2024 10:20:57 +0100 Subject: [PATCH 1/3] Correct a translation. --- locale/de.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/de.po b/locale/de.po index aaaa604..58b677b 100644 --- a/locale/de.po +++ b/locale/de.po @@ -16,7 +16,7 @@ msgstr "Für die Steuer '%(taxname)s' ist die UNECE-Steuerkategorie nicht konfig msgctxt "model:ir.message,text:msg_tax_code_missing" msgid "The UNECE tax code is not configured for tax '%(taxname)s'." -msgstr "Für die Steuer '%(taxname)s' ist der UNECE-Einheitencode nicht konfiguriert." +msgstr "Für die Steuer '%(taxname)s' ist der UNECE Steuercode nicht konfiguriert." msgctxt "model:ir.message,text:msg_uom_code_missing" msgid "The UNECE uom code is not configured for unit '%(uomname)s'." From df4638896795fc281b16859c20666b9226104773 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Thu, 19 Dec 2024 10:22:12 +0100 Subject: [PATCH 2/3] Lookup parent taxes for unece tax codes. In the same way as for categories the unece tax codes must be searched on parents. --- mixin.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mixin.py b/mixin.py index abd7a20..04e94f4 100644 --- a/mixin.py +++ b/mixin.py @@ -144,12 +144,20 @@ class EdocumentMixin(object): def tax_unece_code(self, tax): """ 'tax': invoice.line """ - if not (tax.unece_code or ''): + unece_code = self.get_tax_unece_code(tax) + if not unece_code: raise UserError(gettext( 'edocument_xrechnung.msg_tax_code_missing', taxname=tax.rec_name)) return tax.unece_code + def get_tax_unece_code(self, tax): + while tax: + if tax.unece_code: + return tax.unece_code + break + tax = tax.parent + def get_category_code(self, tax): while tax: if tax.unece_category_code: From 8eb9c284fb604c8baa57edc1ffd3a040cb7a5663 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Thu, 19 Dec 2024 10:42:41 +0100 Subject: [PATCH 3/3] Improve the help text of xrechnung_routeid. --- locale/de.po | 9 ++++++--- party.py | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/locale/de.po b/locale/de.po index 58b677b..dc3b72c 100644 --- a/locale/de.po +++ b/locale/de.po @@ -63,9 +63,12 @@ msgid "X-Rechnung Route-ID" msgstr "X-Rechnung Leitweg-ID" msgctxt "help:party.party,xrechnung_routeid:" -msgid "Enables the need for an XRechnung route ID at the party for exporting the XRechnung." -msgstr "Aktiviert die Notwendigkeit einer XRechnung-Leitweg-ID an der Partei für den Export der XRechnung." - +msgid "" +"When activated an XRechnung route ID must be used for this party for X-Rechnung exports.\n" +"The route ID must be defined as identifier of type \"X-Rechnung Route-ID\"." +msgstr "" +"Bei Aktivierung muss eine XRechnung-Leitweg-ID bei Rechnungsexporten für diese Partei benutzt werden.\n" +"Die Leitweg-ID muss als Identifikator mit Typ \"X-Rechnung Route-ID\" angelegt werden." ############### # account.tax # diff --git a/party.py b/party.py index cc020c6..adcd519 100644 --- a/party.py +++ b/party.py @@ -14,8 +14,10 @@ class Party(metaclass=PoolMeta): xrechnung_routeid = fields.Boolean( string='X-Rechnung Route-ID', - help='Enables the need for an XRechnung route ID at the party ' + - 'for exporting the XRechnung.') + help='When activated an XRechnung route ID must be used ' + 'for this party for X-Rechnung exports.\n' + 'The route ID must be defined as identifier of type ' + '"X-Rechnung Route-ID".') def get_xrechnung_route_id(self): """ search for route-id at party, fire-exception if missing