details: https://code.tryton.org/tryton/commit/9b16b2a43bb4
branch: 7.8
user: Cédric Krier <[email protected]>
date: Thu Aug 06 15:59:39 2026 +0200
description:
Raise PeppolServiceError when missing sender or recipient for Peppyrus
submission
Closes #14999
(grafted from 53f956b55465ca2c1d0c60445ba2b65c359b1da1)
diffstat:
modules/edocument_peppol_peppyrus/edocument.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (21 lines):
diff -r c6b941f7917a -r 9b16b2a43bb4
modules/edocument_peppol_peppyrus/edocument.py
--- a/modules/edocument_peppol_peppyrus/edocument.py Thu Aug 06 15:55:46
2026 +0200
+++ b/modules/edocument_peppol_peppyrus/edocument.py Thu Aug 06 15:59:39
2026 +0200
@@ -79,11 +79,15 @@
@peppyrus_api
def _post_peppyrus(self, document):
tree = etree.parse(BytesIO(document.data))
+ if not (sender := self._peppyrus_sender(document.type, tree)):
+ raise PeppolServiceError("Missing sender")
+ if not (recipient := self._peppyrus_recipient(document.type, tree)):
+ raise PeppolServiceError("Missing recipient")
response = requests.post(
urljoin(URLS[self.peppyrus_server], 'message'),
json={
- 'sender': self._peppyrus_sender(document.type, tree),
- 'recipient': self._peppyrus_recipient(document.type, tree),
+ 'sender': sender,
+ 'recipient': recipient,
'processType': (
self._peppyrus_process_type(document.type, tree)),
'documentType': (