Metadata-Version: 2.1
Name: odoo-addon-l10n_mx_cfdi
Version: 19.0.2.2.0
Requires-Dist: odoo-addon-l10n_mx_catalogs==19.0.*
Requires-Dist: odoo==19.0.*
Requires-Dist: satcfdi
Summary: Allow generating CFDI (Comprobante Fiscal Digital por Internet)
Home-page: https://github.com/OCA/l10n-mexico
License: LGPL-3
Author: Auge TEC, Gray Matter Logic, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 19.0
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

========================
Mexico - CFDI Generation
========================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:296b7818d6ccfd5dd030ce6bf88763f0021e45bdd8bf6ec31f85b409e14c6da6
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
    :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--mexico-lightgray.png?logo=github
    :target: https://github.com/OCA/l10n-mexico/tree/19.0/l10n_mx_cfdi
    :alt: OCA/l10n-mexico
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/l10n-mexico-19-0/l10n-mexico-19-0-l10n_mx_cfdi
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-mexico&target_branch=19.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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.        | SW Sapien   | MYSuite     | Facturama   |
|            |             |             |             | Digital     |             |             |             |
+============+=============+=============+=============+=============+=============+=============+=============+
| Path       | issue()     | issue()     | stamp()     | stamp()     | issue()     | stamp()     | issue()     |
|            |             |             |             |             |             |             | Multiemisor |
|            |             |             |             |             |             |             | / Web       |
+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| Ingreso    | Yes         | Yes         | Yes         | Yes         | Yes         | Yes         | Yes         |
| (I)        |             |             |             |             |             |             |             |
+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| Egreso (E) | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional |
+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| Pago (P)   | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional |
+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| Traslado / | Yes         | Yes         | Yes         | Yes         | Yes         | Yes         | Yes         |
| Carta      |             |             |             |             |             |             |             |
| Porte      |             |             |             |             |             |             |             |
+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| Pedimentos | Yes         | Yes         | Yes         | Yes         | Yes         | Yes         | Yes         |
| on         |             |             |             |             |             |             |             |
| concepts   |             |             |             |             |             |             |             |
+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| Full CCE   | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional | Conditional |
| complement |             |             |             |             |             |             |             |
+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| Cancel     | Conditional | Yes         | No          | No          | Yes         | No          | Yes         |
| (API)      |             |             |             |             |             |             |             |
+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| Cancel     | Conditional | Unknown     | No          | No          | Unknown     | No          | Conditional |
| with acuse |             |             |             |             |             |             |             |
+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+

**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``.

**Table of contents**

.. contents::
   :local:

Installation
============

This module works with any PAC supported by the
`satcfdi <https://github.com/SAT-CFDI/python-satcfdi>`__ library:

- Finkok
- Diverza
- Prodigia
- Comercio Digital
- SW Sapien
- MYSuite
- Facturama

Install the Python dependency:

.. code:: bash

   pip install "satcfdi>=26.7.3"

PAC comparison
--------------

Indicative public list prices as of about 2026-07 (MXN). Amounts and
packages change without notice — always confirm with the vendor before
contracting. OCA and the module authors have no commercial relationship
with these PACs; logos are property of their respective owners and are
used for identification only.

Providers
~~~~~~~~~

|Finkok|

**Finkok** — OnDemand: pay monthly for stamps issued. Public page states
a minimum of about 500 stamps/month (not accumulable); unit rates via
sales (historically cited about 150 MXN + IVA/month for the minimum
block, then about 0.30 MXN + IVA per stamp — exact MXN rates were not
listed on the public OnDemand page at verification time).

- Contract / info: https://finkok.com/ ·
  https://finkok.com/ondemand.html
- Module notes: username/password; supports ``issue()``; cancel requires
  a signer (company FIEL via ``l10n_mx_sat``).

|Diverza|

**Diverza (Timbre Fiscal)** — Pyme about 999 MXN + IVA/year (550 CFDIs);
Empresarial about 1,599 MXN + IVA/year (1,100 CFDIs). Larger plans via
sales.

- Contract / info: https://portaldvz20.diverza.com/cfdi/timbre-fiscal/ ·
  https://www.diverza.com/
- Module notes: PAC RFC, client id, and token; supports ``issue()``.

|Prodigia|

**Prodigia (PADE)** — No public list prices; packages by volume /
contact sales. Stamps without expiry (per vendor marketing).

- Contract / info: https://www.prodigia.com.mx/soluciones/timbrado ·
  https://facturacion.pade.mx/
- Module notes: user/password/contrato; local seal + ``stamp()`` only
  (``supports_issue=False``); cancel not exposed in satcfdi.

|Comercio Digital|

**Comercio Digital** — Example stamp packs (+ IVA), 2-year validity:
200=400; 500=850; 1,000=1,400; 5,000=4,500; 10,000=7,800; 50,000=30,000;
100,000=45,000 MXN.

- Contract / info: https://www.comercio-digital.mx/comprar.html
- Module notes: user/password; local seal + ``stamp()`` only; cancel not
  exposed in satcfdi.

|SW Sapien|

**SW Sapien** — Odoo-oriented stamp packs (public store, MXN; confirm
IVA): 1,200=2,266; 5,000=5,530; 10,000=8,230; 20,000=9,930;
30,000=11,830; 60,000=18,130; 100,000=23,730. No expiry (per vendor).

- Contract / info: https://tienda.sw.com.mx/shop/category/timbres-1 ·
  https://sw.com.mx/ · https://info.sw.com.mx/sw-smarter-odoo
- Module notes: token or user/password; supports ``issue()``.

|MYSuite|

**MYSuite** — Portal folio packs (WEB / PLUS / PREMIUM) for web billing;
WS/API pricing is typically quote-based (confirm with sales).

- Buy / info: https://comprar.mysuitemex.com/ ·
  https://www.mysuitemex.com/ · https://www.portal.mysuitemex.com/
- Module notes: requestor + user; local seal + ``stamp()`` only; cancel
  not exposed in satcfdi.

|Facturama|

**Facturama** — API module about 1,650 MXN/year (incl. IVA), includes
API Web + Multiemisor and 100 folios; additional API folios about 0.50 /
0.45 / 0.40 MXN (incl. IVA) by volume bands.

- Contract / info: https://facturama.mx/planes-facturacion ·
  https://facturama.mx/api-facturacion-electronica
- Module notes: username/password; Multiemisor path used by this module
  — **Registrar** uploads the issuer CSD to the PAC before ``issue()``;
  supports ``issue()``.

Module integration (stamp vs issue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+----------------+----------------+----------------+----------------+
| PAC            | Path           | Cancel in      | Credentials    |
|                |                | satcfdi        | (summary)      |
+================+================+================+================+
| Finkok         | ``issue()``    | Yes (signer    | user /         |
|                | (or stamp)     | required)      | password       |
+----------------+----------------+----------------+----------------+
| Diverza        | ``issue()``    | Yes            | PAC RFC,       |
|                |                |                | client id,     |
|                |                |                | token          |
+----------------+----------------+----------------+----------------+
| Prodigia       | local seal +   | No             | user /         |
|                | ``stamp()``    |                | password /     |
|                |                |                | contrato       |
+----------------+----------------+----------------+----------------+
| Comercio       | local seal +   | No             | user /         |
| Digital        | ``stamp()``    |                | password       |
+----------------+----------------+----------------+----------------+
| SW Sapien      | ``issue()``    | Yes            | token or user  |
|                |                |                | / password     |
+----------------+----------------+----------------+----------------+
| MYSuite        | local seal +   | No             | requestor +    |
|                | ``stamp()``    |                | user           |
+----------------+----------------+----------------+----------------+
| Facturama      | ``issue()``    | Yes            | user /         |
|                | (Multiemisor)  |                | password; CSD  |
|                |                |                | upload on      |
|                |                |                | Registrar      |
+----------------+----------------+----------------+----------------+

Prefer PACs that implement ``issue()`` when possible. Otherwise the
module signs locally with the issuer CSD and calls ``stamp()``.

After installing, follow Configuration to create **CFDI > PAC
Settings**, enter credentials, register issuer CSDs with **Registrar**,
and (when needed) configure series and company FIEL for Finkok cancel.

**Breaking migration from legacy Facturama API**

- Existing documents that only store a Facturama ``tracking_id`` without
  the stamped XML cannot be cancelled or recovered through satcfdi.
  Cancel them at the SAT / previous PAC, or attach the CFDI XML on the
  document first.
- Re-register issuers after switching to the satcfdi Facturama adapter
  so the Multiemisor CSD is uploaded again.
- Prodigia, Comercio Digital, and MYSuite do not expose cancel in
  satcfdi; the Cancel button stays hidden for those providers.
- Prefer PACs that implement ``issue()`` when possible; otherwise the
  module signs locally with the issuer CSD and calls ``stamp()``.

.. |Finkok| image:: https://raw.githubusercontent.com/OCA/l10n-mexico/19.0/l10n_mx_cfdi/static/description/pac_logos/finkok.png
.. |Diverza| image:: https://raw.githubusercontent.com/OCA/l10n-mexico/19.0/l10n_mx_cfdi/static/description/pac_logos/diverza.svg
.. |Prodigia| image:: https://raw.githubusercontent.com/OCA/l10n-mexico/19.0/l10n_mx_cfdi/static/description/pac_logos/prodigia.png
.. |Comercio Digital| image:: https://raw.githubusercontent.com/OCA/l10n-mexico/19.0/l10n_mx_cfdi/static/description/pac_logos/comerciodigital.png
.. |SW Sapien| image:: https://raw.githubusercontent.com/OCA/l10n-mexico/19.0/l10n_mx_cfdi/static/description/pac_logos/swsapien.png
.. |MYSuite| image:: https://raw.githubusercontent.com/OCA/l10n-mexico/19.0/l10n_mx_cfdi/static/description/pac_logos/mysuite.png
.. |Facturama| image:: https://raw.githubusercontent.com/OCA/l10n-mexico/19.0/l10n_mx_cfdi/static/description/pac_logos/facturama.png

Configuration
=============

Follow these stages to connect Odoo to your PAC and prepare issuers for
stamping. For provider pricing, signup links, and stamp vs issue notes,
see Installation.

1. Create PAC Settings
----------------------

1. Go to **CFDI > PAC Settings** and create a record (or open an
   existing one).
2. Set a name and choose the **Provider** (Finkok, Diverza, Prodigia,
   Comercio Digital, SW Sapien, MYSuite, or Facturama).
3. Assign the companies that will use this PAC connection
   (multi-company).

2. Enter credentials
--------------------

Fill in the **Credentials** group fields that apply to your provider
(Settings users / system group):

================ =============================================
Provider         Typical fields
================ =============================================
Finkok           User, Password
Diverza          Password or PAC Token, PAC RFC, PAC Client ID
Prodigia         User, Password, PAC Contract
Comercio Digital User, Password
SW Sapien        PAC Token, or User and Password
MYSuite          User, PAC Requestor, PAC Country (default MX)
Facturama        User, Password
================ =============================================

Credential names and requirements can vary by PAC contract; confirm with
the provider documentation if a field is unclear.

3. Select environment
---------------------

Enable **Sandbox Mode** for the PAC test environment. Leave it disabled
for production.

4. Configure CFDI issuer(s) and register the CSD
------------------------------------------------

1. Go to **CFDI > Issuers** and create an issuer linked to the PAC
   Settings record.
2. Set RFC, fiscal name, ZIP, and tax regime.
3. Upload the CSD certificate, private key, and key password.
4. Click **Registrar** to validate the CSD locally (used for ``stamp()``
   and for cancel where applicable).

Facturama Multiemisor
~~~~~~~~~~~~~~~~~~~~~

For Facturama, **Registrar** also uploads the issuer CSD to the PAC.
That upload is required before ``issue()``. Re-register issuers after
switching to the satcfdi Facturama adapter so the Multiemisor CSD is
uploaded again.

5. Configure series and folios
------------------------------

Go to **CFDI > Series** and define the series prefix and next folio when
your company uses controlled series/folios.

6. Finkok cancel (company FIEL)
-------------------------------

For cancellation with PACs that require a signer (for example Finkok),
install ``l10n_mx_sat`` and configure the company FIEL.

7. Validate the connection
--------------------------

Confirm that the issuer shows as registered, then stamp a test CFDI in
sandbox before switching to production. Prefer PACs that implement
``issue()`` when possible; otherwise the module signs locally with the
issuer CSD and calls ``stamp()``.

Known issues / Roadmap
======================

- Improve PAC cancel/status/recover capability coverage
- Add more PAC-specific credential validation in the UI

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-mexico/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 <https://github.com/OCA/l10n-mexico/issues/new?body=module:%20l10n_mx_cfdi%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Auge TEC
* Gray Matter Logic

Contributors
------------

- Alexis López Zubieta <alexis.lopez@augetec.com>
- Cristhiane Guadalupe Rangel Ferrusca
  <cristhiane.rangel@graymatterlogic.com>
- Maxime Chambreuil <maxime.chambreuil@graymatterlogic.com>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

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-mexico <https://github.com/OCA/l10n-mexico/tree/19.0/l10n_mx_cfdi>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
