Peppol Inbound Attachment Extractor
Extract and store embedded binary attachments from inbound Peppol UBL invoices and credit notes as Odoo attachments
Inbound Peppol invoices routinely carry supporting files — timesheets, delivery notes, photos, contracts — embedded directly inside the UBL XML as base64 binary objects. Odoo imports the invoice but leaves those embedded files locked away inside the raw XML. Peppol Inbound Attachment Extractor pulls every embedded binary out of the UBL and stores it as a first-class Odoo attachment you can open, download and search.
What it does
Parses real Peppol UBL
Reads OASIS UBL 2.1 / Peppol BIS Billing 3.0
Invoice and CreditNote documents
(plus Order, DespatchAdvice and ApplicationResponse). It
walks every cac:AdditionalDocumentReference
(business group BG-24) and reads the attachment carrier
exactly as the standard defines it.
Decodes embedded binaries
Each cbc:EmbeddedDocumentBinaryObject (BT-125)
is base64-decoded into raw bytes and stored as an
ir.attachment linked back to the source
document, using the declared filename
(BT-125-2) and mimeCode (BT-125-1).
Key features
Complete attachment extraction
- Embedded base64 binary objects decoded to real files.
- One Odoo attachment per embedded document, linked to the source inbound document.
- URI-only external references (BT-124) recorded as metadata lines.
- Per-file SHA-256 fingerprint and byte size.
Safe and compliant
- Filename sanitisation defeats path-traversal
(
../../) from hostile senders. - MIME-code derived file extensions when the sender omits a filename.
- Flags any attachment whose MIME code falls outside the Peppol BIS Billing 3.0 allowed set.
- XML parsing hardened against XXE and external-entity network access.
Peppol-allowed MIME codes
The module recognises the embedded-attachment MIME codes permitted by Peppol BIS Billing 3.0 and marks every other code as non-compliant so you can review it.
| MIME code | File type | Status |
|---|---|---|
| application/pdf | Allowed | |
| image/png | PNG image | Allowed |
| image/jpeg | JPEG image | Allowed |
| text/csv | CSV | Allowed |
| application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | XLSX | Allowed |
| application/vnd.oasis.opendocument.spreadsheet | ODS | Allowed |
| other codes | any | Flagged non-compliant |
How to use
- Open Peppol Attachments → Extract Attachments.
- Upload the inbound Peppol UBL XML file. A live preview shows the detected document kind, embedded attachment count and total size.
- Click Extract. The module creates an inbound document record and decodes every embedded file into Odoo attachments.
- Open, download or search the extracted files from the document form or the All Attachments list.
Scope and boundary
This is a pure UBL attachment-extraction utility. It reads UBL documents you have already received and materialises their embedded files inside your own Odoo database. It does not connect to any Access Point, does not transmit anything, and is not a certified Peppol service. No data leaves your database.
Screenshots
Extract Attachments
All Attachments
Inbound Documents
Update date: 2026-07-02