Prerequisites
- Odoo 16.0 or later with Accounting module fully configured
- For Community: OCA account_invoice_ubl from github.com/OCA/edi installed
- Products configured with Internal Reference (maps to UBL SellersItemIdentification)
- Products with EAN/GTIN barcodes where available (maps to UBL StandardItemIdentification)
- Journal sequences configured without gaps for BR-01 compliance
Step-by-Step Setup
Install OCA account_invoice_ubl module
Download from github.com/OCA/edi → branch matching your Odoo version (e.g., 16.0). Place in custom addons folder. Apps → Update Apps List → search "account_invoice_ubl" → Install. Dependencies account_tax_unece and base_ubl are installed automatically. For Enterprise: this is built-in, just enable Electronic Invoicing in Settings.
Configure journal sequence for unique invoice numbers (BR-01)
Invoicing → Configuration → Journals → Customer Invoices journal → Edit. Check "Sequence" settings. Enable "No gaps" if required by your country (Belgium: yes, Netherlands: not required). Invoice numbers must be unique and sequential for BR-01 compliance. Test invoices in dev environments can consume production numbers—use separate database for testing.
Map products to UBL item identification
Sales → Products → each product → Edit. "Internal Reference" field maps to cac:SellersItemIdentification/cbc:ID in UBL. "Barcode" field (if EAN-13 format) maps to cac:StandardItemIdentification with schemeID="0088". Products without any identifier generate BR-64 warnings—acceptable but reduces automation capability for receivers.
Configure tax codes for UNECE mapping
Invoicing → Configuration → Taxes → Edit each tax. In "Advanced Options" section, set UNECE tax category (S=Standard, Z=Zero, E=Exempt, etc.) and UNECE tax type (VAT). This maps to UBL cac:TaxCategory/cbc:ID. Without UNECE mapping, you get generic "VAT" output that may fail BR-S/BR-Z/BR-E rules.
Generate UBL invoice and verify namespace structure
Create invoice → Confirm. Attachments → download UBL XML file. Open in editor and verify: root namespace is "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2", xmlns:cbc for basic components, xmlns:cac for aggregate components. cbc:CustomizationID should contain your target standard (EN16931, Peppol BIS, etc.). Upload to Invoice Navigator for full validation.
Common Odoo Errors
Why this happens in Odoo
Odoo journal sequences may have gaps or resets. Draft invoices that are cancelled and recreated can cause sequence issues. Also, test invoices during implementation may consume production numbers.
How to fix it
Check Invoicing > Configuration > Journals > Customer Invoices sequence. Ensure "No gaps" is enabled if required. Use separate test database for development.
Why this happens in Odoo
Default Odoo decimal precision (2 places for Product Price) causes rounding errors with B2B pricing. Common when unit prices have many decimals.
How to fix it
Technical > Decimal Accuracy > Product Price > set to 4+ digits. Re-save affected products and invoices.
Why this happens in Odoo
Odoo products may lack Standard Item Identification (GTIN/EAN) or Seller Item Identification. Required for some national UBL implementations.
How to fix it
Add product codes: Sales > Products > edit product > Barcode (for GTIN) or Internal Reference (for seller ID).
Pre-Export Checklist for Odoo
Before exporting UBL 2.1 from Odoo, verify these items:
- 1Verify journal sequence has no gaps if required
- 2Confirm decimal accuracy is set to 4+ for Product Price
- 3Ensure products have codes (barcode or internal reference)
- 4Check company legal entity data is complete
- 5Verify customer addresses include postal codes
- 6Test UBL export with a sample invoice
Testing Your Setup
Create a test invoice and check the UBL attachment is generated. Download and inspect XML structure before production use.
💡 OCA account_invoice_ubl module includes test cases. Run Odoo tests to verify your configuration matches expected output.
Validate Your Output
Download UBL attachment from Odoo invoice and upload to Invoice Navigator for validation.
Validate UBL 2.1FAQ
What is the difference between UBL and EN16931?
Should I use UBL or CII format?
Related Guides
Ready to Test Your Odoo Export?
Upload your UBL 2.1 invoice and get instant compliance feedback with Odoo-specific recommendations.
Validate UBL 2.1 Invoice