| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Purchase (purchase) • Discuss (mail) |
| Community Apps Dependencies | Show |
| Lines of code | 6982 |
| Technical Name |
eh_account_einvoice_peppol_as4 |
| License | LGPL-3 |
| Website | https://www.erpheritage.com.au/ |
| Versions | 16.0 17.0 18.0 19.0 |
Peppol AS4 Self-Hosted Gateway
Send and receive e-invoices over Peppol via your own AS4 gateway, with no transaction fees or IAP charges.
Why this module
Peppol AS4 Self-Hosted Gateway
Full infrastructure control
Run your AS4 gateway (Phase4, Holodeck, Oxalis) alongside Odoo on your own servers. No cloud SaaS, no reliance on third-party message brokers, direct audit trail.
No IAP or transaction charges
Unlike cloud Peppol providers, you pay only for your own gateway infrastructure and Odoo instance. Send unlimited invoices without per-document surcharge.
Uses Python stdlib only
HTTP POST/GET with JSON, base64 encoding, urllib. No heavy cryptography reimplemented in Python. Gateway does AS4/ebMS3/XAdES. Easier to audit and integrate.
Day in the life
E-invoicing via your own AS4 gateway
Finance team approves an invoice for Peppol transmission in Odoo. The adapter looks up the recipient's SMP metadata (if configured), hands the UBL document to your AS4 gateway over HTTP, records the gateway's message ID, and moves on. Hours later, the inbound poll queries your gateway for invoices (the parent framework runs this every hour by default)., decodes base64 payloads, and posts received invoices to the journal. Your audit log shows SMP queries, gateway responses, and inbound sender metadata.
Edge cases
The cases most modules quietly ignore.
In the shipped code today, each one a place where a cheaper module silently does the wrong thing.
If SMP base is configured but unreachable, submission continues with a logged warning; the invoice still goes to your gateway. SMP lookup is optional.
HTTP POST to the gateway will raise an error, halting submission. Retry the action once the gateway is back online. Polling gracefully handles partial responses.
Inbound messages with undecodable base64 payloads are skipped with empty xml_bytes; poll continues through the list. Malformed responses do not crash the cron.
If gateway_token is set, Authorization header is added automatically. If empty or missing, no auth header is sent. Gateway can require token or allow public access.
Submit response can use 'messageId' or 'id' field; poll response can be a bare list or a dict with 'messages' key. Adapter maps either to standard fields.
Poll requests send an optional 'since' parameter to filter inbound by receive date. If empty, gateway returns all messages. Adapter stores received_at per message.
What is inside
Built to do the job, end to end.
- adapters/as4_gateway.py. As4GatewayAccessPoint class implements the registration interface: __init__ parses credentials (gateway_url, gateway_token, smp_base, submit_path, poll_path), _smp_lookup() performs HTTP SMP queries with optional base URL, submit() base64-encodes the UBL, POSTs to the gateway, records SMP trace and gateway response, poll() GETs inbound messages with since filter, decodes base64 payloads, maps fields.
- adapters/as4_gateway.py (registration). register_adapter('as4', lambda config: As4GatewayAccessPoint(config)) at module load. Registers this adapter under the 'as4' key in the Peppol access-point registry.
- tests/test_as4_gateway.py. Unit tests verify adapter registration, config validation (missing gateway_url raises), SMP lookup before submit, optional SMP skip, inbound poll message mapping, base64 decode of payloads. HTTP monkeypatched; no network calls.
- peppol_http (inherited tool). Uses eh_account_einvoice_peppol.tools.peppol_http.request() for all HTTP calls. Wrapper handles JSON, timeouts, error mapping to AccessPointError.
Honest about the edges
What this does not do, so nothing surprises you.
- Does not implement AS4 or ebMS3 message exchange; your self-hosted gateway handles that cryptography and Peppol network handshakes.
- No built-in AS4 gateway provided; you must obtain and run (or license) Phase4, Holodeck B2B, Oxalis, or similar compatible gateway separately.
- SMP participant discovery is HTTP-only (no LDAP); requires an accessible HTTP SMP endpoint URL if you want automated lookup before submission.
- No automatic gateway health check or fallback; if the gateway is offline or misconfigured, submission will fail. Relies on your monitoring and ops discipline.
- Configuration is per-company JSON via the Peppol base module settings; no per-user or per-department gateway override.
- Poll cron uses gateway-supplied timestamps; does not validate actual message receipt time or freshness of inbound signing certificates.
Peppol, AS4, e-invoice, self-hosted, gateway, Odoo, ebMS3, SMP, UBL, on-premise, access point, Phase4, Holodeck, Oxalis, LGPL
Modules teams pair with this one.
Premium ERP Heritage modules that extend the same stack, each built to the same engineering bar.
The Canada country pack for the ERP Heritage Employment Hero integration
Imports finalised pay run journals from the Employment Hero payroll platform (KeyPay) into Odoo Community account...
Sync attendance clock events from the Employment Hero people platform into the stock Odoo Attendances app, keyed...
Please log in to comment on this module