| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Discuss (mail)
• Invoicing (account) |
| Lines of code | 1164 |
| Technical Name |
ai_invoice_importer |
| License | LGPL-3 |
| Website | https://www.guznelflow.es/ |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Discuss (mail)
• Invoicing (account) |
| Lines of code | 1164 |
| Technical Name |
ai_invoice_importer |
| License | LGPL-3 |
| Website | https://www.guznelflow.es/ |
OCR - AI SUPPLIER INVOICE IMPORTER
Automatically extract data from supplier invoice PDFs using AI
How It Works
| Step | Process | Technology |
|---|---|---|
| 1 | Upload PDF invoice(s) | Odoo Wizard |
| 2 | Convert PDF to Markdown text | Cloudflare toMarkdown API |
| 3 | Extract structured data (supplier, lines, amounts) | OpenAI API |
| 4 | Create supplier invoice in Odoo | Odoo account.move |
Key Features
Multiple Upload
Upload single or multiple PDF invoices at once. All files are queued for processing.
Queue Processing
Automatic background processing every 5 minutes via cron job. No manual intervention needed.
Smart Extraction
AI extracts supplier info, VAT numbers, dates, line items, quantities, prices, and tax rates.
Auto Supplier Matching
Automatically finds existing vendors by VAT/Tax ID or creates new ones if not found.
Review Before Creating
Review extracted data before creating the invoice, or enable auto-creation for trusted sources.
Screenshots
Upload Wizard
Easy upload interface supporting single or multiple PDF files
Processing Queue
Monitor processing status, view extracted data, and create invoices
Configuration
Configure API keys and processing options
Requirements
External API Keys Required
This module requires API keys from:
- Cloudflare Workers AI - For PDF to Markdown conversion (Account ID + Auth Token)
- OpenAI - For structured data extraction (API Key)
You must have active accounts with both services and accept their terms of service.
Data Privacy
Important Privacy Information
When processing invoices, this module sends PDF documents to external services:
- Cloudflare Workers AI - Receives PDF binary to convert to text
- OpenAI API - Receives extracted text to identify invoice data
No data is permanently stored on external servers. Processing is done in real-time.
By using this module, you confirm that you have the right to process the invoice data through these external services and that you accept their respective privacy policies.
About GuznelFlow
GuznelFlow is a technology-focused agency specialized in digital process automation using artificial intelligence and tools like n8n. Our goal is to eliminate repetitive tasks, reduce errors, and help businesses save time and operational costs.
We work on integrating different systems and platforms so data can flow automatically between them. We have a strong technical background, particularly in Magento 2, e-commerce, and custom software development using technologies such as PHP and Laravel.
GuznelFlow emphasizes the practical and purposeful use of AI rather than adopting it as a trend. We position ourselves as a technical partner that improves efficiency and streamlines digital workflows for businesses.
Support
Need help? Contact us at hola@guznelflow.com
OCR - AI SUPPLIER INVOICE IMPORTER
Overview
OCR - AI SUPPLIER INVOICE IMPORTER is an Odoo 18 module that automatically extracts data from supplier invoice PDFs and creates invoices in Odoo using artificial intelligence.
The module uses a two-step AI pipeline:
- PDF to Markdown: Cloudflare Workers AI (toMarkdown API) converts PDF documents to structured markdown text
- Data Extraction: OpenAI extracts structured invoice data (supplier, amounts, lines) from the markdown
Features
- Multiple PDF Upload: Upload single or multiple invoice PDFs at once
- Queue-based Processing: Automatic background processing via cron job (every 5 minutes)
- AI Data Extraction: Automatically extracts:
- Supplier name and VAT/Tax ID
- Invoice number and date
- Tax base, tax amount, and total
- Individual invoice lines with quantities, prices, and tax rates
- Automatic Supplier Matching: Finds existing vendors by VAT number or creates new ones
- Manual Review Option: Review extracted data before creating invoices
- Configurable Prompt: Customize the AI extraction prompt for your needs
Installation
Requirements
- Odoo 18 Community or Enterprise
- Python requests library (usually pre-installed)
- Cloudflare account with Workers AI access
- OpenAI API key (or compatible API like Azure OpenAI)
Installation Steps
- Copy the ai_invoice_importer folder to your Odoo addons directory
- Restart Odoo server
- Go to Apps and click Update Apps List
- Search for "AI Invoice Importer" and click Install
Configuration
After installation, go to Invoicing → Configuration → Settings and scroll to the OCR - AI SUPPLIER INVOICE IMPORTER section.
Cloudflare Configuration
- Log in to your Cloudflare dashboard
- Go to Workers & Pages → Overview
- Copy your Account ID from the right sidebar
- Go to My Profile → API Tokens and create a token with Workers AI permissions
- Enter both values in Odoo settings
- Click Test Connection to verify
OpenAI Configuration
- Get your API key from https://platform.openai.com/api-keys
- Enter the following in Odoo settings:
- Base URL: https://api.openai.com/v1 (or your custom endpoint)
- Model: gpt-4o (recommended) or another compatible model
- API Key: Your OpenAI API key
- Click Test Connection to verify
Optional Settings
- Default Expense Account: Optional account for invoice lines. If not set, Odoo uses its default.
- Auto Create Invoice: If enabled, invoices are created automatically after extraction. Otherwise, they remain in "Completed" state for manual review.
- PDFs per Cron Run: Number of PDFs to process in each cron execution (default: 5)
Customizing the Extraction Prompt
You can customize the AI prompt used for data extraction:
- Click Download Default Prompt to get the default prompt as a TXT file
- Modify the prompt according to your needs
- Paste the modified prompt in the text field
- Click Save
To restore the default prompt, click Load Default Prompt.
Usage
Uploading Invoices
- Go to Invoicing → Vendors → AI Import Invoices
- Select upload mode:
- Single file: Upload one PDF using the file picker
- Multiple files: Drag and drop or select multiple PDFs
- Click Import PDFs
- The invoices are added to the processing queue
Processing Queue
Go to Invoicing → Vendors → AI Invoice Queue to see all imported invoices.
Queue States
- Pending: Waiting to be processed by the cron job
- Processing: Currently being processed
- Completed: Data extracted successfully, ready for invoice creation
- Error: Processing failed (check error message for details)
Manual Actions
- Process Now: Process a pending invoice immediately without waiting for cron
- Create Invoice: Create the Odoo invoice from extracted data (for completed records)
- Retry: Retry processing for failed records
- View Invoice: Open the created invoice
Viewing Extracted Data
Click on any queue record to see:
- Extracted supplier information (name, VAT)
- Invoice details (number, date, amounts)
- Individual invoice lines with quantities and prices
- Processing log with timestamps
Troubleshooting
Common Issues
- "Cannot connect to Cloudflare"
- Check your Account ID and Auth Token. Ensure your token has Workers AI permissions.
- "Cannot connect to OpenAI"
- Verify your API key and base URL. Check that you have API credits available.
- Invoice totals don't match
- The AI may have difficulty with complex invoice layouts. Try customizing the extraction prompt or manually correct the extracted data before creating the invoice.
- Processing stuck in "Processing" state
- Check the Odoo server logs for errors. You can also check the dedicated log file at /var/log/odoo/ai_invoice_importer.log
Logs
The module writes detailed logs to:
- Odoo server log (standard logging)
- /var/log/odoo/ai_invoice_importer.log (detailed AI processing logs)
Data Privacy
This module sends invoice PDF documents to external APIs for processing:
- Cloudflare Workers AI: Receives the PDF file for text extraction
- OpenAI API: Receives the extracted markdown text for data extraction
Important considerations:
- Documents are processed in real-time and not stored permanently on external servers
- Users must configure their own API keys
- Users are responsible for compliance with their organization's data policies
- Consider using private/self-hosted AI endpoints for sensitive data
Support
- Documentation: https://www.guznelflow.es/
- Support Email: hola@guznelflow.com
- Issues: Contact support for bug reports and feature requests
License
This module is licensed under LGPL-3 (GNU Lesser General Public License v3).
Changelog
Version 3.0.0
- Complete rewrite with Cloudflare + OpenAI pipeline
- Removed legacy Ollama and vision-based processing
- Added configurable extraction prompt
- English translations for international use
- Improved number format handling (European/US)
- Made expense account optional
Please log in to comment on this module