OdooWiki OCA HUB

Paraguay - Electronic Invoicing Base

l10n_py_edi_base folder_open OCA/l10n-paraguay open_in_new
Accounting/Localizations/EDI License: LGPL-3

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 integration
  • l10n_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 accounting
  • l10n_py_base: Base Paraguayan localization
  • l10n_py_account: Accounting extensions (timbrado management)
  • product: Product management
  • sale: Sales management

auto_awesome What this module does

AI-generated from the code · Odoo 20.0

Adds Paraguay electronic invoicing (SIFEN) support to invoices and credit notes, letting users prepare, preview, send and track electronic tax documents, generate QR codes and KUDE PDFs, and manage EDI connectors and logs.

This module prepares Odoo invoices for Paraguay's electronic tax system (SIFEN). On customer invoices and credit notes, users get extra fields for emission type, transaction type, presence type, payment type, exchange rate condition, and a security code. When an invoice is confirmed, its EDI status is set to 'to send'.

From the invoice, buttons let users preview the XML, preview the KUDE (printed representation PDF), send the document to the EDI provider, retry, cancel, and download the XML or KUDE. A QR code and its string are stored on the invoice.

Business rules are enforced before sending: the company RUC, the customer's RUC or identity document, the customer address, the journal's timbrado (authorization) and its validity are checked. Each invoice line must have a tax, and products need an NCM code. Invoices over Gs. 7,000,000 cannot be anonymous. Specific checks apply to credit notes, debit notes, delivery notes and self-invoices, including associated documents and transport data.

A scheduled job checks EDI status. Menus give access to EDI connectors, operation logs, number inutilization, associated documents and transport records. A KUDE report is available. The module also adds RUC and activity fields to companies, and NCM and unit code fields to products.

Depends on

Menus it adds

ConectoresFacturación ElectrónicaLogs EDIConectores
Models and fields (14)
  • res.company · extends an existing modell10n_py_dv (DV), l10n_py_ruc (RUC), l10n_py_ruc_full (RUC Completo), l10n_py_city_code (Código Ciudad SET), l10n_py_trade_name (Nombre Fantasía), l10n_py_district_code (Código Distrito SET), l10n_py_department_code (Código Departamento SET), l10n_py_economic_activity (Descripción Actividad Económica), l10n_py_economic_activity_code (Código Actividad Económica)
  • account.move · extends an existing modell10n_py_cdc (CDC), l10n_py_edi_xml (XML Firmado), l10n_py_qr_code (Código QR), l10n_py_kude_pdf (KUDE (PDF)), l10n_py_is_export, l10n_py_qr_string (String QR), l10n_py_edi_status (Estado EDI), l10n_py_nre_motive (Motivo de Remisión (E501)), l10n_py_receipt_id (Receipt ID), l10n_py_edi_message (Mensaje EDI), l10n_py_edi_batch_id (ID de Lote), l10n_py_payment_type (Tipo de Pago), l10n_py_transport_id (Datos de Transporte), l10n_py_doc_type_code, l10n_py_emission_type (Tipo de Emisión), l10n_py_kude_filename (KUDE Filename), l10n_py_presence_type (Tipo de Presencia), l10n_py_security_code (Código de Seguridad), l10n_py_afe_vendor_city (Ciudad Vendedor (EA016)), l10n_py_afe_vendor_name (Nombre Vendedor (EA009)), l10n_py_afe_vendor_house (Nro. Casa Vendedor (EA011)), l10n_py_edi_xml_filename (XML Filename), l10n_py_transaction_type (Tipo de Transacción), l10n_py_afe_provision_city (Ciudad Provisión (EA023)), l10n_py_afe_vendor_address (Dirección Vendedor (EA010)), l10n_py_contingency_motive (Motivo de Contingencia), l10n_py_afe_constancia_type (Tipo de Constancia (EA002)), l10n_py_afe_vendor_district (Distrito Vendedor (EA014)), l10n_py_afe_vendor_doc_type (Tipo Doc. Vendedor (EA006)), l10n_py_afe_constancia_number (Número de Constancia (EA004))
  • l10n_py.edi.log · new modelcdc (CDC), error (É Erro), method (Método HTTP), success (Sucesso), batch_id (ID do Lote), endpoint, provider (Provedor), error_code (Código de Erro), document_id (Documento), retry_count (Tentativas), status_code (Código de Status), request_data (Dados Enviados), error_message (Mensagem de Erro), response_data (Resposta Recebida), duration_human (Duração), execution_time (Tempo de Execução (ms)), operation_type (Tipo de Operação), request_headers (Headers da Requisição), response_headers (Headers da Resposta)
  • product.template · extends an existing modell10n_py_ncm_code (Código NCM), l10n_py_unit_code (Código Unidad de Medida)
  • l10n_py.transport · new modelmove_id (Documento), incoterm (Condición de Negociación (E906)), company_id, driver_name (Nombre del Chofer (E951)), vehicle_ids (Vehículos), delivery_ids (Entregas), departure_city (Ciudad Salida (E928)), transport_mode (Modalidad de Transporte (E901)), transport_type (Tipo de Transporte (E903)), transporter_dv (DV del Transportista (E943)), departure_house (Número de Casa Salida (E921)), manifest_number (Número de Manifiesto / Conocimiento (E907)), transporter_ruc (RUC del Transportista (E942)), transporter_name (Nombre del Transportista (E941)), departure_address (Dirección de Salida (E920)), driver_doc_number (Doc. del Chofer (E950)), departure_district (Distrito Salida (E926)), transport_end_date (Fecha Fin Transporte (E910)), transporter_nature (Naturaleza del Transportista (E940)), departure_department (Departamento Salida (E924)), transport_start_date (Fecha Inicio Transporte (E909)), freight_responsibility (Responsable del Flete (E905))
  • l10n_py.edi.connector · new modelname, active, timeout, company_id, environment, provider_type (Proveedor)
  • l10n_py.edi.cancel.wizard · new modelmotive (Motivo de Cancelación), invoice_id (Factura)
  • l10n_py.edi.document.type · new modelcode (Código), name (Nombre), description (Descripción)
  • l10n_py.edi.logging.mixin · new model
  • l10n_py.transport.vehicle · new modelbrand (Marca (E961)), plate_number (Número de Identificación (E962)), transport_id (Transporte), vehicle_type (Tipo de Vehículo (E960))
  • l10n_py.transport.delivery · new modelcity (Ciudad (E938)), address (Dirección de Entrega (E930)), district (Distrito (E936)), department (Departamento (E934)), house_number (Número de Casa (E931)), transport_id (Transporte)
  • l10n_py.associated.document · new modelcdc (CDC), move_id (Factura), doc_date (Fecha del Documento (H010)), timbrado, doc_number (Número de Documento), doc_type_code (Tipo de Documento Impreso (H009)), establishment (Establecimiento), constancia_type (Tipo de Constancia (H011)), association_type (Tipo de Asociación (H002)), expedition_point (Punto de Expedición), constancia_number (Número de Constancia (H012))
  • account.move.send.edi.wizard · new modelinvoice_id (Factura)
  • l10n_py.number.inutilization · new modelstate (Estado), motive (Motivo), quantity (Cantidad), number_to (Número Hasta), company_id, number_from (Número Desde), authorization_id (Timbrado)

Text generated by AI (DeepSeek) from reading the Odoo 20.0 code on GitHub; it may contain mistakes, so check the code before deciding. The module is very large and only part of the code was read. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 4 confirmed, 5 with no information of 9 versions.

Sources · Odoo 16.0

Confirmed on 2026-11-03 in branch 16.0 of OCA/l10n-paraguay.

terminal Installation and usage

OCA documentation · Odoo 20.0

Installation

Prerequisites

Required Modules

  • Odoo 16.0
  • account: Core accounting module
  • l10n_py_base: Paraguayan base localization
  • l10n_py_account: Accounting extensions with timbrado
  • product: Product management
  • sale: Sales management

Required Python Packages The module requires these Python packages:

  • qrcode: QR code generation
  • requests: HTTP client for API calls
  • cryptography: 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_base
  • l10n_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_factpy documentation, or
  • See l10n_py_edi_facturasend documentation

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

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_factpy module
  • Configure credentials in connector settings

Option B: FacturaSend

  • Install l10n_py_edi_facturasend module
  • 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

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
info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.