How paulargoud/account-invoice-digitize-ai works
This Odoo add-on digitizes vendor bills: an accountant or incoming-email flow initiates extraction, the invoice model coordinates document handling and AI extraction, and results are validated, matched, and applied or reviewed in a preview. Separate branches cover optional OCR services, structured Factur-X and QR input, batch/background processing, vendor learning and reliability, and safety checks. The source index and excerpts establish several internal calls; README-documented capabilities support the broader workflow. Some subsystem links remain unverified because their implementations were not sampled.
Main entry points: account_move.py Invoice integration · ai_field_mapper.py Field mapping · ai_extraction_engine.py Extraction engine · ai_document.py Document analysis
Components 28
Document intake
- Invoice integration
models/account_move.py - Document analysis
models/ai_document.py - Factur-X parser
models/ai_facturx_parser.py - QR decoder
models/ai_qr_decoder.py - Preprocess routing
models/ai_preprocess_pipeline.py - Preprocessor interface
models/ai_preprocessor.py - Azure OCR
models/ai_preprocessor_azure.py - AWS Textract
models/ai_preprocessor_aws.py
Extraction pipeline
- Extraction engine
models/ai_extraction_engine.py - Prompt construction
models/ai_prompt.py - Fiscal context
models/ai_fiscal_context.py - Provider interface
models/ai_provider.py - AI provider implementations
models
Accounting enrichment
- Extraction validation
models/ai_validator.py - Field mapping
models/ai_field_mapper.py - Invoice line building
models/ai_line_builder.py - Accounting matchers
models/ai_matcher.py
Reliability and learning
- Vendor memory
models/ai_vendor_memory.py - Vendor scoring
models/ai_vendor_score.py - Amount anomalies
models/ai_anomaly_detector.py - Duplicate detection
models/ai_duplicate_detector.py
Review and operations
- Extraction preview
wizards/ai_preview_wizard.py - Preview line items
wizards/ai_preview_line.py - Batch extraction
wizards/ai_batch_extract_wizard.py - Background extraction
models/ai_cron_processor.py - Extraction analytics
models/ai_extraction_log.py - Confidence auto-apply
models/ai_auto_apply.py
Other components
- Accountant / email
Connections 29
- Accountant / email → Invoice integration: uploads bill
- Invoice integration → Extraction engine: starts extraction
- Extraction engine → Document analysis: prepares document
models/ai_extraction_engine.py - Extraction engine → Preprocess routing: runs preprocessing
- Preprocess routing → Preprocessor interface: selects service
models/ai_preprocess_pipeline.py - Preprocessor interface → Azure OCR: creates Azure handler
models/ai_preprocessor.py - Preprocessor interface → AWS Textract: creates AWS handler
models/ai_preprocessor.py - Document analysis → Factur-X parser: parses embedded XML
- Document analysis → QR decoder: decodes payment QR
- Extraction engine → Prompt construction: builds prompt
models/ai_extraction_engine.py - Prompt construction → Fiscal context: adds fiscal context
models/ai_fiscal_context.py - Extraction engine → Provider interface: calls AI provider
models/ai_extraction_engine.py - Provider interface → AI provider implementations: dispatches provider
models/ai_extraction_engine.py - Extraction engine → Extraction validation: checks extraction
models/ai_extraction_engine.py - Invoice integration → Field mapping: maps extracted fields
- Field mapping → Accounting matchers: matches accounting data
models/ai_field_mapper.py - Field mapping → Invoice line building: builds invoice lines
- Field mapping → Vendor memory: uses vendor history
models/ai_field_mapper.py - Field mapping → Vendor scoring: checks reliability
models/ai_field_mapper.py - Field mapping → Amount anomalies: checks unusual amounts
models/ai_field_mapper.py - Field mapping → Duplicate detection: checks duplicates
models/ai_field_mapper.py - Invoice integration → Extraction preview: opens review
- Extraction preview → Preview line items: shows line items
- Extraction preview → Invoice integration: applies reviewed data
- Accountant / email → Batch extraction: selects invoices
- Batch extraction → Invoice integration: requests extraction
- Background extraction → Invoice integration: processes queued bills
- Invoice integration → Extraction analytics: records extraction
- Invoice integration → Confidence auto-apply: checks confidence