Repository
OCA/l10n-mexico · module folder · Try on Runboat
Module version
Category
Accounting
Folder size
0.51 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/l10n-mexico
Last tracking update
2026-08-15 05:29:24
Authors
Odoo Community Association (OCA), Gray Matter Logic, Auge TEC
Maintainers
Odoo Community Association (OCA), Gray Matter Logic, Auge TEC
Committers
Maxime Chambreuil, OCA-git-bot, oca-ci
Odoo dependencies
OCA/l10n-mexico:
odoo/odoo:
- web
- bus
- uom
Python dependencies
satcfdi
System dependencies
None
Required by
l10n_mx_cfdi_account
Description
This module provides the configuration used by electronic invoicing for Mexico:

- Multi-PAC integration via satcfdi (Finkok, Diverza, Prodigia, Comercio Digital,
  SW Sapien, MYSuite, Facturama).
- Local CSD management for CFDI sealing when the PAC uses ``stamp()``.
- Facturama Multiemisor CSD upload on issuer registration (required before
  ``issue()``).
- Management of different series and CFDI issuers for the same company.

**CFDI × PAC capability matrix**

| Flow | Finkok | Diverza | Prodigia | Com. Digital | SW Sapien | MYSuite | Facturama |
|------|:------:|:-------:|:--------:|:------------:|:---------:|:-------:|:---------:|
| Path | issue() | issue() | stamp() | stamp() | issue() | stamp() | issue() Multiemisor / Web |
| Ingreso (I) | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Egreso (E) | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional |
| Pago (P) | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional |
| Traslado / Carta Porte | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Pedimentos on concepts | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Full CCE complement | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional |
| Cancel (API) | Conditional | Yes | No | No | Yes | No | Yes |
| Cancel with acuse | Conditional | Unknown | No | No | Unknown | No | Conditional |

**Legend**

- **Yes**: supported end-to-end via this module + satcfdi for that PAC.
- **Conditional**:
  - Egreso: requires a fully reconciled refund (``amount_residual == 0``).
  - Pago: auto-stamp only for reconciled inbound payments on **PPD** invoices;
    manual stamping needs valid payment CFDI data.
  - Finkok cancel: requires company FIEL via ``l10n_mx_sat`` (signer).
  - Facturama cancel acuse: may be empty; the module shows status/message when
    the PAC omits the acuse.
  - Full CCE: built by ``l10n_mx_cfdi_comex`` (``Exportacion=02`` +
    ``cce20.ComercioExterior``). Stamp PACs (Prodigia, Comercio Digital,
    MYSuite) and XML-issue PACs (Finkok, Diverza, SW) can stamp sealed XML with
    CCE (live PAC acceptance not exhaustively retested here). Facturama
    Multiemisor does **not** support CCE; when CCE is present the module
    switches to FacturamaWeb (same user/password; account-profile CSD).
- **No**:
  - Cancel API is not exposed in satcfdi for Prodigia, Comercio Digital, and
    MYSuite (``supports_cancel=False``).
- **Unknown**: acuse availability depends on the PAC response (Diverza /
  SW Sapien).
- **Path**: Finkok, Diverza, SW Sapien, and Facturama use ``issue()``; Prodigia,
  Comercio Digital, and MYSuite use local CSD seal + ``stamp()``. Facturama is
  Multiemisor by default (**Registrar** uploads the CSD); FacturamaWeb is used
  automatically for Comercio Exterior.
- Pedimentos on concepts are not the full CCE complement; the Facturama adapter
  maps ``NumerosPedimento``.

Code Analysis

Views touched (17)
XML IDNameModelTypeStatus
action_l10n_mx_cfdi_service_form CFDI Service Settings l10n_mx_cfdi.cfdi_service form New
cfdi_id_data cfdi_id_data ir.ui.view qweb New
cfdi_issuer_data cfdi_issuer_data ir.ui.view qweb New
cfdi_payment_data cfdi_payment_data ir.ui.view qweb New
cfdi_receiver_data cfdi_receiver_data ir.ui.view qweb New
cfdi_related_documents cfdi_related_documents ir.ui.view qweb New
cfdi_signature_data cfdi_signature_data ir.ui.view qweb New
default_issuer_data default_issuer_data ir.ui.view qweb New
default_receiver_data default_receiver_data ir.ui.view qweb New
l10n_mx_cfdi_series_form_view Serie CFDI l10n_mx_cfdi.series form New
l10n_mx_cfdi_series_list_view Serie CFDI l10n_mx_cfdi.series list New
product_template_form_view_inherit Product Template: CFDI code and measurement unit fields product.template form Inherits product.product_template_form_view
view_cfdi_issuer CFDI Issuer l10n_mx_cfdi.issuer form New
view_l10n_mx_cfdi_document_form CFDI Form View l10n_mx_cfdi.document form New
view_l10n_mx_cfdi_document_list CFDI List View l10n_mx_cfdi.document list New
view_l10n_mx_cfdi_document_search CFDI Search View l10n_mx_cfdi.document search New
view_partner_form_inherit Partner: tax regime field res.partner form Inherits base.view_partner_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (9)

New fields (15)
  • company_ids Many2many → res.company
    default=<expr> string='Companies' args: 'res.company'
  • name Char
    required=True
  • pac_client_id Char
    groups='base.group_system' string='PAC Client ID'
  • pac_contrato Char
    groups='base.group_system' string='PAC Contract'
  • pac_country Char
    default='MX' groups='base.group_system' string='PAC Country'
  • pac_requestor Char
    groups='base.group_system' string='PAC Requestor'
  • pac_rfc Char
    groups='base.group_system' string='PAC RFC'
  • pac_token Char
    groups='base.group_system' string='PAC Token'
  • password Char
    groups='base.group_system'
  • provider Selection
    default='finkok' groups='base.group_system' required=True selection=<expr>
  • sandbox_mode Boolean
    default=False groups='base.group_system'
  • stamps_available Integer
    readonly=True string='Stamps available'
  • supports_cancel Boolean
    compute='_compute_pac_capabilities'
  • supports_issue Boolean
    compute='_compute_pac_capabilities'
  • user Char
    groups='base.group_system'
Public methods (9)
  • cancel_cfdi(self, cfdi_or_xml, reason, uuid_replacement=None, issuer=None, document_id=None)
  • check_cfdi_status(self, uuid, issuer_rfc, receiver_rfc, amount_total)
    Query CFDI status through the PAC when supported; otherwise unknown.
  • create_cfdi(self, cfdi, issuer=None)
    Seal/stamp a CFDI via the configured PAC and return a normalized result. Prefers ``pac.issue()`` when the provider supports it; otherwise signs locally with the issuer CSD and calls ``pac.stamp()``.
  • delete_issuer_csd(self, issuer)
    Remove issuer CSD from PACs that store it remotely (Facturama).
  • get_cancellation_request_proof(self, tracking_id: str)
    Return cancellation acknowledgment PDF/XML when available via recover.
  • get_cfdi_pdf(self, tracking_id: str)
    Try to recover PDF from the PAC when available.
  • get_cfdi_xml(self, tracking_id: str)
  • upload_issuer_csd(self, issuer)
    Upload issuer CSD to PACs that require remote registration (Facturama).
  • validate_csd(self, issuer)
    Validate that the issuer CSD can be loaded (local registration).

New fields (7)
  • currency_id Many2one → res.currency
    default=<expr> readonly=True required=True string='Moneda' args: 'res.currency'
  • partner_id Many2one → res.partner
    default=<expr> ondelete='restrict' readonly=True required=True string='Contacto' args: 'res.partner'
  • service_id Many2one → l10n_mx_cfdi.cfdi_service
    ondelete='cascade' required=True string='Servicio' args: 'l10n_mx_cfdi.cfdi_service'
  • stamp_number Integer
    required=True string='Cantidad de Folios'
  • stamp_price Monetary
    currency_field='currency_id' required=True string='Precio por Folio'
  • topup_date Datetime
    default=fields.Datetime.now() string='Fecha de Adquisición'
  • total Monetary
    compute='_compute_total' currency_field='currency_id' store=True string='Precio Total'
Public methods (0)

No public methods.

New fields (38)
  • cancellation_request_proof_file Binary
    attachment=True readonly=True string='Acuse de solicitud de cancelación'
  • cancellation_request_proof_filename Char
    readonly=True string='Nombre del archivo de acuse de solicitud de cancelación'
  • cert_data_json Char
    readonly=True
  • cert_number Char
    compute='_compute_load_json_data' readonly=True string='Número de certificado'
  • cfdi_signature Char
    compute='_compute_load_json_data' readonly=True string='Firma del CFDI'
  • company_id Many2one → res.company
    default=<expr> required=True args: 'res.company'
  • files_in_cache Boolean
    compute='_compute_download_files_if_needed' readonly=True store=False
  • folio Char
  • is_global_note Boolean
    default=False readonly=True string='Nota global'
  • issuer_id Many2one → l10n_mx_cfdi.issuer
    domain=[('registered', '=', True)] required=True string='Emisor' args: 'l10n_mx_cfdi.issuer'
  • issuing_datetime Datetime
    compute='_compute_load_json_data' readonly=True string='Fecha de emisión'
  • l10n_mx_cfdi_auto Boolean
    readonly=True related='company_id.l10n_mx_cfdi_auto' string='CFDI Automatico'
  • l10n_mx_cfdi_enabled Boolean
    readonly=True related='company_id.l10n_mx_cfdi_enabled' string='CFDI Habilitado'
  • legacy_without_xml Boolean
    compute='_compute_legacy_without_xml' help='Published CFDI without stored stamped XML (typically Facturama-era). Cancel/download via satcfdi is not available for these documents.' string='Legacy without XML'
  • name Char
    compute='_compute_name' readonly=True store=True string='Nombre'
  • original_string Char
    compute='_compute_load_json_data' readonly=True string='Cadena original'
  • pac_provider Char
    help='satcfdi PAC code used when the CFDI was stamped.' readonly=True string='PAC Provider'
  • pac_supports_cancel Boolean
    readonly=True related='issuer_id.service_id.supports_cancel'
  • pdf_file Binary
    attachment=True readonly=True string='Archivo PDF'
  • pdf_filename Char
    readonly=True string='Nombre del archivo PDF'
  • receiver_id Many2one → res.partner
    required=True string='Receptor' args: 'res.partner'
  • related_document_ids One2many → l10n_mx_cfdi.document_relation
    string='Documentos relacionados' args: 'l10n_mx_cfdi.document_relation', 'source_id'
  • rfc_prov_certif Char
    compute='_compute_load_json_data' readonly=True string='RFC del proveedor de certificación'
  • sat_cert_number Char
    compute='_compute_load_json_data' readonly=True string='Número de certificado del SAT'
  • sat_signature Char
    compute='_compute_load_json_data' readonly=True string='Firma del SAT'
  • serie Char
  • signing_date Datetime
    compute='_compute_load_json_data' readonly=True string='Fecha de timbrado'
  • standalone Boolean
    compute='_compute_standalone' help='Si está marcado, el certificado no esta relacionado a otros documentos del sistema' store=True string='Independiente'
  • state Selection
    default='draft' readonly=True string='Estado' args: [('draft', 'Borrador'), ('pending', 'Pendiente'), ('published', 'Publicada'), ('pending_cancel', 'Cancelación pendiente'), ('canceled', 'Cancelada'), ('unknown', 'Desconocido')]
  • tax_codes Char
    compute='_compute_load_json_data' readonly=True string='Código de impuesto'
  • tracking_id Char
    readonly=True string='ID del documento en el API'
  • type Selection
    readonly=True args: [('I', 'Ingreso'), ('E', 'Egreso'), ('P', 'Pago'), ('T', 'Traslado')]
  • uuid Char
    help='UUID asignado por el SAT' readonly=True string='UUID'
  • verification_qr_code Binary
    compute='_compute_load_json_data' readonly=True string='Código QR de Verificación'
  • verification_url Char
    compute='_compute_load_json_data' readonly=True string='URL de verificación'
  • version Char
    default='4.0'
  • xml_file Binary
    attachment=True readonly=True string='Archivo XML'
  • xml_filename Char
    readonly=True string='Nombre del archivo XML'
Public methods (6)
  • action_cancel(self)
  • action_check_status(self)
  • action_get_cancellation_request_proof(self)
  • cancel(self, reason: str, replacement=None, simulate=False)
    Cancel the CFDI through the PAC. Returns a feedback dict with keys ``Status``, ``Message``, ``HasAcuse`` so wizards can show clear post-cancel feedback.
  • create(self, vals_list)
    @api.model_create_multi
  • publish(self, cfdi)

New fields (3)
  • relation_type_id Many2one → l10n_mx_catalogs.c_tipo_relacion
    required=True args: 'l10n_mx_catalogs.c_tipo_relacion'
  • source_id Many2one → l10n_mx_cfdi.document
    ondelete='cascade' required=True args: 'l10n_mx_cfdi.document'
  • target_id Many2one → l10n_mx_cfdi.document
    ondelete='cascade' required=True args: 'l10n_mx_cfdi.document'
Public methods (0)

No public methods.

New fields (9)
  • certificate_file Binary
    groups='base.group_system'
  • company_id Many2one → res.company
    default=<expr> args: 'res.company'
  • fiscal_name Char
    help='Razón Social del Emisor'
  • key_file Binary
    groups='base.group_system'
  • key_password Char
    groups='base.group_system' string='Password'
  • logo_url Char
    string='URL del logo'
  • partner_id Many2one → res.partner
    delegate=True ondelete='cascade' required=True args: 'res.partner'
  • registered Boolean
    store=True
  • service_id Many2one → l10n_mx_cfdi.cfdi_service
    args: 'l10n_mx_cfdi.cfdi_service'
Public methods (3)
  • default_get(self, fields_list)
    @api.model
  • register_issuer(self)
    Validate and activate the local CSD for stamping. For Facturama Multiemisor, also uploads the CSD to the PAC (required before ``issue()``).
  • unregister_issuer(self)
    Deactivate the local CSD registration flag.

New fields (1)
  • code Char
    copy=False
Public methods (1)
  • create(self, vals_list)
    @api.model_create_multi

New fields (2)
  • l10n_mx_cfdi_product_code_id Many2one → l10n_mx_catalogs.c_clave_prod_serv
    string='Código de Producto' args: 'l10n_mx_catalogs.c_clave_prod_serv'
  • l10n_mx_cfdi_product_measurement_unit_id Many2one → l10n_mx_catalogs.c_clave_unidad
    string='Unidad de Medida' args: 'l10n_mx_catalogs.c_clave_unidad'
Public methods (0)

No public methods.

New fields (2)
  • l10n_mx_cfdi_auto Boolean
    default=True help='Enable to automatically sign CFDI when validating invoices.' args: 'Create CFDI on post'
  • l10n_mx_cfdi_enabled Boolean
    compute='_compute_l10n_mx_cfdi_enabled' help='Enable CFDI for this company.' args: 'Enable CFDI'
Public methods (0)

No public methods.

New fields (4)
  • cfdi_use_id Many2one → l10n_mx_catalogs.c_uso_cfdi
    string='CFDI Usage' args: 'l10n_mx_catalogs.c_uso_cfdi'
  • payment_form_id Many2one → l10n_mx_catalogs.c_forma_pago
    string='Payment Form' args: 'l10n_mx_catalogs.c_forma_pago'
  • payment_method_id Many2one → l10n_mx_catalogs.c_metodo_pago
    string='Payment Method' args: 'l10n_mx_catalogs.c_metodo_pago'
  • tax_regime Many2one → l10n_mx_catalogs.c_regimen_fiscal
    string='Fiscal Regime' args: 'l10n_mx_catalogs.c_regimen_fiscal'
Public methods (0)

No public methods.

Loading…

Loading…