| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) |
| Community Apps Dependencies | Show |
| Lines of code | 16446 |
| Technical Name |
account_invoice_import_llm |
| License | AGPL-3 |
| Website | https://github.com/apexive/odoo-llm |
| Versions | 16.0 18.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) |
| Community Apps Dependencies | Show |
| Lines of code | 16446 |
| Technical Name |
account_invoice_import_llm |
| License | AGPL-3 |
| Website | https://github.com/apexive/odoo-llm |
| Versions | 16.0 18.0 |
Process Invoices in 2 Minutes
Instead of 20
AI-powered invoice data extraction with OCR—automatically processes vendor invoices and populates all fields in one shot
Is Your AP Team Drowning in Invoices?
You're not alone. Here's what teams tell us every day:
20+ minutes per invoice
Your team works overtime every month-end just to keep up with invoice backlog
Every vendor, different format
Constant confusion and errors because no two invoices look the same
Data entry mistakes
Wrong payments lead to vendor disputes and damaged relationships
Can't scale
Considering hiring more people just for invoice data entry
The Transformation
20 Minutes
- Receive PDF invoice via email
- Download and open file
- Manually type: vendor, date, amounts, line items
- Double-check calculations
- Verify against PO (open another system)
- Correct inevitable mistakes
- Save and route for approval
2 Minutes
- Upload PDF invoice to Odoo
- AI automatically reads PDF via OCR
- AI extracts all data in one shot (vendor, dates, amounts, lines)
- Review auto-filled invoice
- Confirm → Done
90% Time Savings
Smart Invoice Extraction—Powered by AI
This isn't just OCR. It's an AI that understands invoices. It extracts vendor information, line items, tax calculations, dates, and amounts in one shot. Works with any invoice format—PDFs, scanned documents, or images. Integrates seamlessly with OCA's invoice import wizard as an intelligent fallback parser.
What Makes This Different
One-Shot Extraction
Auto-Validation
OCA Integration
Any Format
The Business Case Your CFO Wants to See
Real numbers that matter to your bottom line
Example ROI Calculation
Per Week
Reduction
Required
Coverage
Powerful Features
Automatic Processing
Upload PDF to invoice → EDI decoder triggers automatically → Invoice fields populate instantly. Zero clicks required.
One-Shot Data Extraction
Single LLM call extracts all invoice data: vendor info, dates, line items, tax calculations, amounts. No multi-turn conversation needed.
Smart Data Mapping
Automatically converts LLM output to OCA's Invoice Pivot Format. Handles vendor matching, product mapping, and tax calculations.
Data Mapping
Converts LLM output to OCA's Invoice Pivot Format automatically. Seamless integration with OCA wizard.
OCR Integration
Powered by Mistral OCR for perfect text extraction, even from fuzzy scans or phone photos.
EDI Decoder Integration
Registers in Odoo's EDI decoder chain. XML parsers run first, LLM-OCR as intelligent fallback. Process 100 invoices in parallel.
Real Scenarios from Real Accounting Teams
See how teams like yours save time every day
Month-End Closing Rush
50 invoices piled up → Process all in 2 hours instead of 2 days → Close books on time
International Vendors
Invoice in German with EUR amounts → AI reads, converts currency, extracts VAT → All ready for approval
Complex Multi-Page Invoices
10-page itemized bill with 100+ line items → AI processes entire document → Validates total → Done
New Employee Onboarding
New hire processes first invoice perfectly on day 1 → AI guides them → No training needed
OCA Wizard Integration
Upload invoice via OCA wizard → No XML found → LLM-OCR fallback extracts data automatically → Invoice created seamlessly
Three Ways to Extract Invoice Data
Automatic Processing
RECOMMENDED
Upload PDF to invoice â EDI decoder triggers automatically â OCR extracts text â LLM extracts data â Invoice populated
Manual Trigger
FOR EXISTING INVOICES
Open draft invoice â Click "Process with AI" button â Form reloads with extracted data
OCA Wizard Fallback
OCA INTEGRATION
Upload via OCA wizard â No XML found â LLM extraction used as fallback â Invoice created
See It In Action
From setup to processing — here's how easy it is
1 Configure Mistral Provider
Add your Mistral API key and sync models. Mistral OCR is essential for parsing invoice attachments — it reads PDF documents and extracts text from images with high accuracy.
2 Mistral OCR for Document Parsing
After syncing, the mistral-ocr-latest model is automatically available for parsing invoice attachments. This model specializes in reading PDFs, scanned documents, and extracting structured data from images.
3 LLM Provider for Data Extraction
Configure any LLM provider (ChatGPT, Gemini, Claude, etc.) for intelligent data extraction from OCR text. The LLM understands invoice structure and extracts structured data in one shot.
4 Click "Process with AI" on Draft Invoice
Open any draft vendor bill and click the "Process with AI" button to manually trigger extraction. The form will reload with all fields populated automatically.
5 Invoice Automatically Filled
After AI processing, the form reloads with extracted data: vendor, date, amounts, line items. All populated in one shot. Review and confirm!
Seamless Odoo Integration
- Native Odoo Accounting module integration
- Only shows on draft invoices (clean UI)
- No data leaves your Odoo instance
- Works with your existing approval workflows
- Zero configuration required
Trusted AI Technology
Apexive Solutions LLC
Trusted by enterprises worldwide
Mistral AI Powered
European leader in open AI
Open Source
Part of Odoo LLM Suite
github.com/apexive/odoo-llm
Processing 10,000+ invoices monthly for accounting teams worldwide
Ready to Save 15 Hours Every Week?
Join accounting teams already processing invoices 90% faster
Need help getting started?
support@apexive.comAccount Invoice Import LLM
AI-powered invoice data extraction with OCR for Odoo 16 - integrates with OCA's account_invoice_import.
Features
- 📄 Automatic OCR Extraction: Extract invoice data from PDFs and images using Mistral OCR
- 🤖 One-Shot AI Processing: Single LLM call extracts all invoice data (vendor, dates, amounts, line items)
- 🔗 OCA Integration: Seamlessly extends account_invoice_import wizard as fallback parser
- ⚡ EDI Decoder: Automatically processes attachments via Odoo's EDI decoder chain
- 🔘 Manual Trigger: "Process with AI" button for on-demand extraction
- 📊 Smart Data Mapping: Converts LLM output to OCA's Invoice Pivot Format
Installation
Install dependencies:
- account_invoice_import (OCA - invoice import wizard)
- llm_assistant (LLM infrastructure)
- llm_mistral (Mistral provider for OCR)
Install the module:
odoo-bin -d your_database -i account_invoice_import_llm
Configure Mistral provider in Settings → LLM → Providers
Usage
Three Ways to Extract Invoice Data
Automatic Processing (Recommended)
Simply upload a PDF or image to an invoice:
- Create a new vendor bill (Accounting → Vendors → Bills)
- Attach an invoice PDF or image
- Invoice is automatically processed!
- EDI decoder triggers on attachment upload
- OCR extracts text from document
- LLM extracts structured data
- Invoice fields are populated
Manual Processing
For invoices created before module installation:
- Open a draft invoice with an attached PDF/image
- Click "Process with AI" button
- Form reloads with extracted data
OCA Invoice Import Wizard
When using OCA's invoice import wizard:
- Go to Accounting → Vendors → Import Vendor Bill
- Upload PDF invoice
- If no embedded XML found, LLM extraction is used as fallback
- Invoice is created with extracted data
What Gets Extracted
The LLM extracts and populates:
- ✅ Vendor name and VAT number
- ✅ Invoice number and reference
- ✅ Invoice date and due date
- ✅ Currency
- ✅ Subtotal, tax, and total amounts
- ✅ Line items with descriptions, quantities, unit prices, and tax rates
Module Architecture
OCA Invoice Import Integration
Follows the standard OCA pattern for extending account_invoice_import:
account_invoice_import_llm/
├── __manifest__.py # Dependencies and metadata
├── __init__.py # Pre-init hook for module rename
├── models/
│ ├── account_invoice_import_ocr.py # AbstractModel: OCR + LLM extraction
│ └── account_move.py # "Process with AI" button
├── wizard/
│ └── account_invoice_import.py # OCA fallback_parse_pdf_invoice()
├── data/
│ ├── llm_prompt_invoice_data.xml # One-shot extraction prompt
│ └── llm_assistant_data.xml # Assistant configuration
└── views/
└── account_move_views.xml # Button view extension
Processing Flows
Flow 1: Automatic Decoder (Odoo Native):
1. User uploads PDF to invoice ↓ 2. account.move.create_document_from_attachment_decoders() ↓ 3. _llm_ocr_decoder() checks if PDF is suitable ↓ 4. Creates draft invoice with journal ↓ 5. _extract_invoice_data_from_attachment() - Creates LLM thread with OCR context - Runs one-shot extraction prompt - Returns extracted data as JSON ↓ 6. _populate_invoice_from_data() - Populates vendor, dates, amounts - Creates invoice lines - Processes UBL XML if present ↓ 7. Decoder returns invoice ↓ 8. Journal links attachment to invoice
Flow 2: Manual Trigger:
1. User clicks "Process with AI" button ↓ 2. action_process_with_llm() - Validates invoice is draft - Finds PDF/image attachment ↓ 3. _extract_invoice_data_from_attachment() - Same extraction as automatic flow ↓ 4. _populate_invoice_from_data() - Populates invoice fields ↓ 5. Returns action to reload form view ↓ 6. User sees populated invoice data
Flow 3: OCA Wizard Fallback:
1. User uploads PDF via OCA wizard ↓ 2. Wizard calls parse_pdf_invoice() ↓ 3. Checks for embedded XML (UBL, Factur-X) - If found: Uses XML parser - If not found: Calls fallback_parse_pdf_invoice() ↓ 4. Our fallback_parse_pdf_invoice() - Creates temp invoice for context - Extracts data via LLM - Converts to OCA's Invoice Pivot Format ↓ 5. Wizard creates invoice from pivot format ↓ 6. Wizard automatically links attachment
Key Components
OCR Extraction AbstractModel
File: models/account_invoice_import_ocr.py
Central extraction logic shared by wizard and manual button:
- Runs Mistral OCR on file bytes
- Renders prompt with OCR text context
- Calls LLM for structured extraction
- Converts to OCA Invoice Pivot Format
One-Shot Extraction Prompt
File: data/llm_prompt_invoice_data.xml
Structured prompt that instructs LLM to extract invoice data in JSON format.
OCA Wizard Integration
File: wizard/account_invoice_import.py
Extends fallback_parse_pdf_invoice() to delegate to OCR AbstractModel.
Technical Details
EDI Decoder Registration
The module registers _llm_ocr_decoder in Odoo's EDI decoder chain:
@api.model
def _get_create_document_from_attachment_decoders(self):
decoders = super()._get_create_document_from_attachment_decoders()
return decoders + [self._llm_ocr_decoder]
Decoder priority ensures XML parsers run first, LLM-OCR as fallback.
Error Handling Strategy
- Top-level handlers: Decoder, manual action, OCA wizard
- Intermediate methods: Raise exceptions directly (no hiding)
- User-friendly errors: Clear messages about what failed and why
- Logging: Detailed error info in server logs for debugging
Pre-Init Hook
File: __init__.py
Handles module rename from llm_assistant_account_invoice → account_invoice_import_llm:
- Updates ir_model_data records from old module name
- Adopts orphaned records (prevents FK violations)
- Prevents duplicate key errors on installation
Configuration
Invoice Extraction Assistant
Location: Settings → LLM → Assistants → Invoice Data Extraction (Automatic)
The assistant is pre-configured with:
- Prompt: One-shot extraction template with detailed instructions
- Model: Any LLM (GPT-4, Claude, Gemini, etc.)
- OCR Tool: Mistral OCR for text extraction
- Dynamic Context: OCR text injected automatically
Customization
To customize extraction behavior:
- Go to Settings → LLM → Prompts → Invoice Data Extraction (One-Shot)
- Edit the instructions argument to add/remove fields
- Update the JSON structure in default_values
- Modify _convert_llm_data_to_pivot() if adding new fields
Troubleshooting
Issue: "No PDF or image attachment found"
Solution: Attach a PDF or image file to the invoice before clicking "Process with AI"
Issue: "Failed to extract data"
Possible causes:
- Poor quality scan/image
- Non-standard invoice format
- OCR couldn't extract text
Solution: Check server logs for detailed error. Try with a higher quality scan.
Issue: "Mistral provider not configured"
Solution: Install llm_mistral module and configure Mistral provider with API key
Issue: Duplicate records after module rename
Solution: The pre-init hook should handle this automatically. If issues persist, check ir_model_data for orphaned records.
Credits
Authors
- Apexive Solutions LLC
Contributors
- Module development and LLM integration
- OCA invoice import pattern implementation
Maintainers
This module is maintained by Apexive Solutions LLC.
License
LGPL-3
Please log in to comment on this module