details: https://code.tryton.org/tryton/commit/3ae6e2f93d28
branch: 7.8
user: Cédric Krier <[email protected]>
date: Mon Jan 19 16:21:30 2026 +0100
description:
Be more flexible when converting Peppyrus document type into edocument
type
Closes #14519
(grafted from 65ef36edc7c6ee522219cfb057ef3b1542c5ee5c)
diffstat:
modules/edocument_peppol_peppyrus/edocument.py | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diffs (37 lines):
diff -r 840d234b6ed7 -r 3ae6e2f93d28
modules/edocument_peppol_peppyrus/edocument.py
--- a/modules/edocument_peppol_peppyrus/edocument.py Sat Jan 17 12:53:33
2026 +0100
+++ b/modules/edocument_peppol_peppyrus/edocument.py Mon Jan 19 16:21:30
2026 +0100
@@ -23,6 +23,14 @@
'production': 'https://api.peppyrus.be/v1/',
}
+UBL_NAMESPACES = {
+ 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2',
+ 'urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2',
+ }
+BIS_BILLING_3 = (
+ 'urn:cen.eu:en16931:2017#compliant'
+ '#urn:fdc:peppol.eu:2017:poacc:billing:3.0')
+
def peppyrus_api(func):
@wraps(func)
@@ -222,11 +230,13 @@
@classmethod
def _peppyrus_type(cls, document_type):
- if document_type == (
- 'busdox-docid-qns::urn:oasis:names:specification:ubl:'
- 'schema:xsd:Invoice-2::Invoice##'
- 'urn:cen.eu:en16931:2017#compliant#'
- 'urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1'):
+ schema, document_identifier = document_type.split('::', 1)
+ syntax, customization = document_identifier.split('##', 1)
+ namespace, localname = syntax.split('::', 1)
+ customization_id, version = customization.split('::', 1)
+ if (schema in {'busdox-docid-qns', 'peppol-doctype-wildcard'}
+ and namespace in UBL_NAMESPACES
+ and customization_id in BIS_BILLING_3):
return 'bis-billing-3'
@classmethod