Prerequisites
- Odoo 16.0 or later (14.0 minimum for OCA modules)
- For Community: OCA modules account_invoice_ubl and account_einvoice_generate from GitHub
- For Enterprise: Electronic Invoicing feature enabled (Settings → Invoicing)
- Company settings complete: VAT ID with country prefix, legal address, bank account
- Decimal Accuracy settings reviewed (default 2 digits often insufficient)
Step-by-Step Setup
Install e-invoicing module: OCA path or Enterprise path
OCA (Community): Apps → Update Apps List → search "account_invoice_ubl" → Install. Also install "account_einvoice_generate" for automatic attachment. Enterprise: Settings → Invoicing → check "Electronic Invoicing" feature → Save. Enterprise includes built-in EN 16931 support without additional modules.
Configure company VAT and legal entity data
Settings → Companies → select company → Edit. Critical fields: VAT (with country prefix, e.g., BE0123456789), Company Registry (KBO/BCE number for Belgium), Street address (must include postal code), Bank Account (IBAN format). These map to EN 16931 BT-31 (Seller VAT), BT-30 (Seller legal registration), BG-5 (Seller address), BG-17 (Payment means).
Fix decimal precision to avoid BR-CO-10 calculation errors
Settings → Technical → Database Structure → Decimal Accuracy. Find "Product Price" → change from default 2 to 4 or 6 digits. Also check "Product Unit of Measure" and "Account". This is the #1 cause of BR-CO-10 (line amount calculation mismatch) in Odoo. B2B pricing with many decimals (e.g., €0.0125/unit) rounds incorrectly with 2-digit precision.
Configure automatic UBL attachment on invoice validation
For OCA: Settings → Invoicing → Electronic Invoice → enable "Auto-generate UBL on invoice validation". For Enterprise: this is automatic when Electronic Invoicing is enabled. The UBL XML appears as an attachment on the validated invoice. File is named [invoice_number].xml.
Test invoice generation and validate structure
Invoicing → Customers → Invoices → Create test invoice. Confirm (validate) the invoice. Go to invoice → Attachments → download the UBL XML file. Open in text editor to verify: namespace should be "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2", CustomizationID should reference EN 16931. Upload to Invoice Navigator for full business rule validation.
Common Odoo Errors
Why this happens in Odoo
Odoo uses configurable decimal precision per field type. Default "Product Price" precision (2 digits) may be insufficient for B2B pricing with many decimals, causing line amount mismatches.
How to fix it
Settings > Technical > Database Structure > Decimal Accuracy > set "Product Price" to 4 digits. Recalculate existing invoices if needed.
Why this happens in Odoo
When copying invoices or using templates in Odoo, line IDs may duplicate or not regenerate. OCA modules may have different line ID generation logic than Enterprise.
How to fix it
For OCA: Check account_invoice_ubl module version. For Enterprise: verify Electronic Invoicing settings generate unique line IDs.
Why this happens in Odoo
Generic service products in Odoo may have empty or minimal descriptions. EN16931 requires meaningful item descriptions, not just "Service" or "Product".
How to fix it
Update product templates with descriptive names. Use invoice line "Description" field for specific service details.
Pre-Export Checklist for Odoo
Before exporting EN16931 from Odoo, verify these items:
- 1Verify company VAT ID is correctly formatted with country prefix
- 2Confirm customer party data is complete (name, address, VAT ID)
- 3Check decimal accuracy settings for Product Price (recommend 4 digits)
- 4Ensure invoice lines have meaningful descriptions
- 5Verify line totals match invoice total (no rounding errors)
- 6Test with a few invoices before enabling automatic export
Testing Your Setup
Create a test invoice in Odoo and validate the UBL XML attachment. Download from invoice form > Attachments > UBL file.
💡 OCA provides test invoices in the account_invoice_ubl module tests. Check GitHub OCA/account-invoicing for sample data.
Validate Your Output
Export UBL XML attachment from Odoo invoice and upload to Invoice Navigator EN16931 validator.
Validate EN16931FAQ
Does Odoo Community support EN16931?
Can Odoo generate country-specific variants?
Related Guides
Ready to Test Your Odoo Export?
Upload your EN16931 invoice and get instant compliance feedback with Odoo-specific recommendations.
Validate EN16931 Invoice