OCA/l10n-paraguay · 18.0
Paraguay - Electronic Invoicing Base
l10n_py_edi_base
Paraguay - Electronic Invoicing Base
Paraguay - Electronic Invoicing Base
This module provides the base functionality for electronic invoicing (facturación electrónica) in Paraguay, compliant with SET (Subsecretaría de Estado de Tributación) requirements.
Features
Document Types Support
- Factura Electrónica: Electronic invoice
- Nota de Crédito Electrónica: Electronic credit note
- Nota de Débito Electrónica: Electronic debit note
- Nota de Remisión Electrónica: Electronic delivery note
- Autofactura Electrónica: Electronic self-invoice
Core Functionality
- Data Models: Complete models for electronic documents
- Field Extensions: Enhanced account.move, res.partner, and res.company
- Fiscal Validation: RUC and DV validation
- JSON Builder: Automatic generation of JSON for SIFEN
- QR Code Generation: Ready for KUDE (Código Único de Documento Electrónico)
- Log System: Complete audit trail of EDI operations
Compliance
- SIFEN Compatible: Sistema Integrado de Facturación Electrónica Nacional
- SET Requirements: Meets all SET regulatory requirements
- Contingency Mode: Support for offline operation
- KUDE Support: Ready for electronic document codes
Integration Ready
This is a base module that requires a connector:
l10n_py_edi_factpy: FactPy integrationl10n_py_edi_facturasend: FacturaSend integration
Technical Architecture
- Provider-agnostic: Works with multiple EDI providers
- Extensible: Easy to add new document types
- Robust: Error handling and retry mechanisms
- Auditable: Complete logging of all operations
Dependencies
account: Core accountingl10n_py_base: Base Paraguayan localizationl10n_py_account: Accounting extensions (timbrado management)product: Product managementsale: Sales management
Table of contents
Installation
Installation
Prerequisites
Required Modules
- Odoo 16.0
account: Core accounting modulel10n_py_base: Paraguayan base localizationl10n_py_account: Accounting extensions with timbradoproduct: Product managementsale: Sales management
Required Python Packages
The module requires these Python packages:
qrcode: QR code generationrequests: HTTP client for API callscryptography: Encryption and security
EDI Provider
You must choose and configure one provider:
- FactPy (install
l10n_py_edi_factpy) - FacturaSend (install
l10n_py_edi_facturasend)
Installation Steps
Step 1: Install Dependencies
Install required Python packages:
pip install qrcode requests cryptography
Step 2: Install Base Modules
- Install prerequisites in order:
l10n_py_basel10n_py_account
Step 3: Install EDI Base
- Go to Apps
- Click Update Apps List
- Search for "Paraguay - Electronic Invoicing Base"
- Click Install
Step 4: Install EDI Connector
Choose and install a connector:
Option A: FactPy
- Search for "Paraguay - FactPy EDI Connector"
- Click Install
Option B: FacturaSend
- Search for "Paraguay - FacturaSend EDI Connector"
- Click Install
Post-Installation Configuration
Step 1: Verify Installation
Check that new menus appear:
- Facturación Electrónica main menu
- EDI Logs submenu
- Connectors submenu
Step 2: Configure Company
- Go to Settings > Companies
- Edit your company
- Configure Electronic Invoicing tab:
- Enable EDI
- Select environment (Test/Production)
- Choose provider
Step 3: Configure EDI Provider
Follow provider-specific configuration:
- See
l10n_py_edi_factpydocumentation, or - See
l10n_py_edi_facturasenddocumentation
Step 4: Configure Security
- Go to Settings > Users & Companies > Groups
- Assign users to EDI groups:
- Electronic Invoicing / User
- Electronic Invoicing / Manager
Step 5: Initial Test
- Set environment to Test
- Create a test invoice
- Try sending to EDI
- Verify reception and approval
- Check logs for errors
Data Initialization
The module loads:
- Electronic document type definitions
- Cron job configurations
- Email templates
- Report templates
No manual data loading required.
System Parameters
Configure in Settings > Technical > Parameters > System Parameters:
| Parameter | Description | Example |
|---|---|---|
l10n_py.edi_provider | Active EDI provider | factpy or facturasend |
l10n_py.edi_environment | Environment | test or production |
l10n_py.edi_auto_send | Auto-send on confirm | True or False |
Database Preparation
Existing Invoices
For existing invoices (pre-EDI):
- They will NOT be sent to EDI automatically
- You can migrate them manually if needed
- New invoices will use EDI
Product Updates
Update products with:
- Tax configuration
- NCM codes (if applicable)
- GTIN/barcodes
Partner Updates
Ensure all partners have:
- Complete address
- Valid RUC (for taxpayers)
- Email address
- Taxpayer type
Testing Checklist
Before going to production:
- Test environment configured
- Test credentials working
- Sample invoice sent successfully
- PDF download works
- XML download works
- QR code generates correctly
- Status updates work
- Credit note flow tested
- Cancellation tested
- Error handling tested
- Email sending tested
- All users have correct permissions
Production Deployment
Pre-Production
- Backup database
- Complete all testing
- Train users
- Prepare support documentation
Go-Live
- Switch to production environment
- Update provider credentials
- Configure production parameters
- Send first real invoice
- Monitor logs closely
Post-Go-Live
- Monitor EDI logs daily
- Check success rate
- Respond to errors quickly
- Keep system updated
Troubleshooting Installation
Python Packages Not Found
If packages are missing:
pip install -r requirements.txt
Or install individually:
pip install qrcode requests cryptography
Module Not Installing
If installation fails:
- Check Odoo logs
- Verify all dependencies installed
- Check file permissions
- Restart Odoo server
Menus Not Appearing
If menus don't show:
- Check user permissions
- Refresh browser
- Clear browser cache
- Verify module is installed (not just downloaded)
Uninstallation
To uninstall (not recommended):
- First uninstall connector module
- Then uninstall base module
- Data will be preserved but EDI features disabled
Warning: Uninstalling will:
- Disable EDI functionality
- Remove EDI menus
- Keep existing data but make it inaccessible
Upgrade Notes
When upgrading:
- Backup database first
- Test in staging environment
- Check changelog for breaking changes
- Update connectors to matching versions
- Test EDI functionality after upgrade
Configuration
Configuration
Initial Setup
Step 1: Company Configuration
- Go to Settings > General Settings > Companies
- Edit your company
- Navigate to Electronic Invoicing tab:
- Enable Electronic Invoicing
- Configure Environment (Test/Production)
- Set EDI Provider (factpy/facturasend)
Step 2: Select EDI Provider
Choose and configure your provider:
Option A: FactPy
- Install
l10n_py_edi_factpymodule - Configure credentials in connector settings
Option B: FacturaSend
- Install
l10n_py_edi_facturasendmodule - Configure credentials in connector settings
Step 3: Configure Products
For each product/service:
- Go to Products
- Edit product
- In Invoicing tab:
- Set NCM Code (if applicable)
- Configure GTIN (barcode for SET)
- Set tax information
Step 4: Partner Configuration
Ensure customers have complete fiscal data:
- Valid RUC (if taxpayer)
- Correct Taxpayer Type
- Complete Address (required for electronic invoicing)
- Email (for sending electronic documents)
Document Type Configuration
Available Document Types
The module pre-configures these document types:
- Factura Electrónica (1): Standard invoice
- Nota de Crédito (4): Credit note
- Nota de Débito (5): Debit note
- Nota de Remisión (7): Delivery note
- Autofactura (2): Self-invoice
Journal Configuration
- Go to Accounting > Configuration > Journals
- For each sales journal:
- Enable Electronic Invoicing
- Select Document Type
- Ensure timbrado is configured
Security Groups
Configure user permissions:
- Go to Settings > Users & Companies > Users
- Edit user
- In Electronic Invoicing section:
- User: Can create and send documents
- Manager: Can configure and cancel documents
Automatic Operations
Cron Jobs
The module includes automatic jobs:
- Check Document Status: Polls provider for status updates
- Retry Failed Documents: Attempts to resend failed documents
Configure in Settings > Technical > Automation > Scheduled Actions:
- Adjust frequency as needed
- Enable/disable jobs
Automatic Sending
Configure automatic sending on invoice confirmation:
- Go to company settings
- In Electronic Invoicing tab:
- Enable Auto Send on Confirm
- Set Auto Download PDF/XML
Environment Configuration
Test Environment
For testing:
- Set Environment = "Test"
- Use test credentials from provider
- Documents won't be legally valid
Production Environment
For production:
- Set Environment = "Production"
- Use production credentials
- Ensure all fiscal data is accurate
- Test thoroughly before going live
KUDE Configuration
KUDE (Código Único de Documento Electrónico) settings:
- QR codes are generated automatically
- Configure QR size in report templates if needed
- KUDE appears on printed invoices
Contingency Mode
Configure fallback when EDI service is unavailable:
- Enable Contingency Mode in company settings
- Set Contingency Reason options
- Documents can be sent later when service recovers
Email Configuration
For automatic email sending:
- Configure Outgoing Mail Server in Odoo
- Set email template in Settings > Technical > Email Templates
- Customize "Electronic Invoice" template
Usage
Usage
Sending Electronic Invoices
Method 1: Automatic Sending
If auto-send is enabled:
- Create invoice as usual
- Click Confirm
- System automatically sends to EDI provider
- Status updates to "Sent" when successful
Method 2: Manual Sending
- Create and confirm invoice
- Click Send EDI button
- Wizard appears - review information
- Click Send
- Wait for confirmation
Document Status
Electronic invoices have these statuses:
- Draft: Not yet confirmed
- To Send: Confirmed, ready to send
- Sending: Being sent to provider
- Sent: Successfully sent
- Approved: Approved by SET
- Rejected: Rejected by SET
- Cancelled: Cancelled document
- Error: Error occurred
Checking Document Status
View Status
- Open invoice
- Check EDI Status field
- View EDI Information tab for details
Manual Status Update
To manually check status:
- Open invoice
- Click Update EDI Status button
- System queries provider
- Status and messages update
Cancelling Electronic Documents
Requirements
- Document must be approved by SET
- Within cancellation timeframe (per SET rules)
- Valid cancellation reason
Process
- Open approved invoice
- Click Cancel EDI button
- Select Cancellation Reason
- Enter Reason Details
- Click Cancel Document
- System sends cancellation to SET
Downloading Documents
PDF Download
- Open invoice
- Click Download EDI PDF button
- PDF opens/downloads
- Contains KUDE QR code
XML Download
- Open invoice
- Click Download EDI XML button
- XML file downloads
- Valid SET-compliant XML
Credit and Debit Notes
Creating Credit Note
- From invoice, click Add Credit Note
- Select reason
- System creates note with EDI reference
- Send to EDI as usual
Creating Debit Note
- From invoice, click Add Debit Note
- Enter reason
- System creates note with EDI reference
- Send to EDI as usual
Monitoring EDI Operations
EDI Log
View all EDI operations:
- Go to Facturación Electrónica > EDI Logs
- Filter by:
- Document
- Status
- Date
- Error type
Error Handling
When errors occur:
- Check EDI Logs for details
- Review error message
- Fix issue (e.g., missing data)
- Click Retry button
- Document resends
Printing KUDE
Invoice with KUDE
When printing invoices:
- Click Print on invoice
- Select KUDE Report
- Report includes:
- QR code
- CDC (Código de Control)
- All fiscal information
- SET-compliant format
QR Code
The QR code contains:
- Document number
- RUC
- CDC
- Amounts
- Validation URL
Customers can scan to verify authenticity.
Batch Operations
Sending Multiple Documents
- Go to invoice list view
- Select multiple invoices
- Click Action > Send EDI
- System sends all selected documents
- Check status individually
Updating Multiple Statuses
- Select documents
- Click Action > Update EDI Status
- System checks all selected documents
Customer Portal
Customers can:
- Access their invoices via portal
- Download PDF with KUDE
- Download XML if needed
- View EDI status
Reports and Analytics
EDI Dashboard
View EDI metrics:
- Go to Facturación Electrónica > Dashboard
- See:
- Documents sent today/week/month
- Success rate
- Pending documents
- Errors
Custom Reports
Create custom reports:
- Use invoice filters
- Filter by EDI Status
- Group by status, date, customer
- Export to Excel
Troubleshooting Common Issues
Issue: "Missing Customer Email"
Solution:
- Add email to customer record
- Retry sending
Issue: "Invalid RUC"
Solution:
- Verify customer RUC format
- Check verification digit
- Update customer record
- Retry
Issue: "Timbrado Expired"
Solution:
- Update timbrado in journal
- May need to cancel and recreate invoice
Issue: "Connection Error"
Solution:
- Check internet connection
- Verify provider credentials
- Check provider service status
- Try again or enable contingency mode
Best Practices
- Test First: Use test environment before production
- Monitor Logs: Regularly check EDI logs
- Keep Updated: Update status of pending documents
- Backup: Download and store PDF/XML copies
- Validate: Ensure all fiscal data is complete before sending
Known issues / Roadmap
Roadmap
Current Version: 16.0.1.0.0
This document outlines planned features and improvements for the Paraguay Electronic Invoicing module.
Short Term (Next Release)
Enhanced Validation
- More comprehensive RUC validation
- Automatic DV calculation for RUC
- Product code validation against SET catalog
- Real-time validation before sending
Improved User Experience
- Better error messages with suggested fixes
- Inline EDI status on invoice form
- Dashboard with EDI statistics
- Bulk operations improvement
Additional Reports
- Monthly EDI summary report
- Tax authority compliance report
- Document tracking report
- Error analysis report
Medium Term (2-3 Releases)
Additional Document Types
- Comprobante de Retención (Retention receipt)
- Factura de Exportación (Export invoice)
- Factura de Importación (Import invoice)
- Boleta de Venta (Sales receipt)
Integration Enhancements
- Direct SIFEN integration (bypass third-party)
- Webhook support for status updates
- Batch sending optimization
- Offline mode improvements
Advanced Features
- Electronic credit management
- Payment integration with electronic documents
- Multi-currency support for EDI
- Document routing rules
Compliance Updates
- Support for SET regulation changes
- Enhanced contingency mode
- Document versioning
- Legal archive management (7-year retention)
Long Term (Future Vision)
AI and Automation
- Intelligent error detection and correction
- Automatic document classification
- Predictive timbrado expiration alerts
- Smart retry strategies
Integration Ecosystem
- Point of Sale (POS) integration
- E-commerce integration
- Accounting software exports
- Bank reconciliation integration
Analytics and Intelligence
- Advanced EDI analytics
- Customer behavior insights
- Tax optimization suggestions
- Compliance scoring
Mobile Support
- Mobile app for document approval
- QR code scanning verification
- Mobile notifications
- Offline mobile capabilities
Additional Providers
- Additional EDI provider integrations
- Provider comparison tools
- Automatic failover between providers
- Cost optimization across providers
Technical Improvements
Performance
- Asynchronous document sending
- Caching layer for provider responses
- Database query optimization
- Bulk operation performance
Code Quality
- Increase test coverage to 90%+
- API documentation
- Developer guide
- Code refactoring for maintainability
Security
- Enhanced credential encryption
- Audit trail improvements
- Role-based access control refinement
- Security compliance certifications
Community Requests
We track community feature requests. Top requests:
- Multi-company enhancements - Better support for groups
- Import automation - Automatically import vendor electronic invoices
- API exposure - REST API for external systems
- Customs integration - Integration with customs systems
- Transportation documents - Support for e-transport documents
Contributing
Want to contribute to the roadmap?
- Submit feature requests via GitHub issues
- Vote on existing feature requests
- Contribute code via pull requests
- Join development discussions
Version Planning
v16.0.2.0.0 (Q2 2024)
- Enhanced validation
- Additional reports
- UX improvements
v16.0.3.0.0 (Q3 2024)
- New document types
- Improved integrations
- Performance optimizations
v17.0.1.0.0 (Q4 2024)
- Odoo 17 migration
- New features from roadmap
- Architecture improvements
Deprecation Notices
Planned Deprecations
- Legacy provider adapters will be deprecated in v17.0
- Old XML format support ends in v16.0.5.0.0
- Python 3.7 support ends with v16.0 series
Migration Paths
Documentation will be provided for all deprecations with clear migration paths and timelines.
Feedback
This roadmap is subject to change based on:
- SET regulatory changes
- Community feedback
- Technical constraints
- Resource availability
Submit feedback:
- GitHub issues
- Community forums
- Direct contact with maintainers
Last updated: 2024
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Authors
- KMEE
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
This module is part of the OCA/l10n-paraguay project on GitHub.
You are welcome to contribute. To learn how please visit <https://odoo-community.org/page/Contribute>.





