Mexico - SAT Connection
l10n_mx_sat · OCA/l10n-mexico
Health
77/100
good
-
Security25/25No findings
-
Activity25/25Last human commit 1 month ago
-
Required by15/251 module depends on it
-
Maturity12/25In 2 Odoo series since 18.0
Heuristic over the facts below, not an audit · How it's computed
Required by
1
Modules depending on it
External deps
1 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.5 MB
Module directory on disk
Code analysis
0 migration notes
5 models
9 views
0 HTTP endpoints
Description
Description
Base module to connect Odoo to the Mexican Tax Administration (SAT) portal using FIEL electronic signature credentials.
It provides:
- Multi-company FIEL credentials stored on each
res.companyrecord. - A SAT tab on the company form to configure download flows, sync dates, and manual synchronization.
- A secure FIEL credentials wizard that stores certificate, key, and password without exposing saved values in the UI.
- Generic SAT document storage (
l10n_mx_sat.document) for CFDIs and retentions, both issued and received. - A download orchestration layer (
l10n_mx_sat.download.request) that handles XML mass downloads viasatcfdi. - Configurable XML download flows per company: CFDI issued/received and retentions issued/received.
- An adapter (
SatClient) that wraps communication with the SAT via thesatcfdilibrary. Other modules can use this adapter without depending directly onsatcfdi. - A factory method
company.l10n_mx_sat_get_client()that returns an adapter instance. It can be overridden via_inheritto swap the underlying implementation.
This module downloads and stores SAT XML documents. Automatic metadata
synchronization is postponed for a future release. Other custom modules
may consume l10n_mx_sat.document records for their own business flows.
Dependencies
- Odoo dependencies
-
odoo/odoo:- base
- Python dependencies
- satcfdi
- System dependencies
- None
- Required by
- l10n_mx_sat_vendor_bill
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 9
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
l10n_mx_sat_company_connection_view_list |
res.company.l10n_mx_sat.connection.list | res.company | list | New |
l10n_mx_sat_document_view_form |
l10n_mx_sat.document.form | l10n_mx_sat.document | form | New |
l10n_mx_sat_document_view_list |
l10n_mx_sat.document.list | l10n_mx_sat.document | list | New |
l10n_mx_sat_document_view_search |
l10n_mx_sat.document.search | l10n_mx_sat.document | search | New |
l10n_mx_sat_download_request_view_form |
l10n_mx_sat.download.request.form | l10n_mx_sat.download.request | form | New |
l10n_mx_sat_download_request_view_list |
l10n_mx_sat.download.request.list | l10n_mx_sat.download.request | list | New |
l10n_mx_sat_download_request_view_search |
l10n_mx_sat.download.request.search | l10n_mx_sat.download.request | search | New |
l10n_mx_sat_fiel_credentials_wizard_view_form |
l10n_mx_sat.fiel.credentials.wizard.form | l10n_mx_sat.fiel.credentials.wizard | form | New |
view_company_form_inherit_l10n_mx_sat |
res.company.form.inherit.l10n_mx_sat | res.company | form | Inherits base.view_company_form |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 5
New fields (21)
-
attachment_idMany2one → ir.attachmentcomodel_name='ir.attachment'ondelete='set null'readonly=Truestring='XML' -
cancellation_dateDatetimereadonly=Truestring='Cancellation date' -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>index=Truereadonly=Truerequired=Truestring='Company' -
currency_codeCharreadonly=Truestring='Currency' -
directionSelectionindex=Truereadonly=Truerequired=Trueselection=[('issued', 'Issued'), ('received', 'Received')] -
display_nameCharcompute='_compute_display_name'readonly=Truestore=True -
document_kindSelectionindex=Truereadonly=Truerequired=Trueselection=[('cfdi', 'CFDI'), ('retention', 'Retention')]string='Document kind' -
download_request_idMany2one → l10n_mx_sat.download.requestcomodel_name='l10n_mx_sat.download.request'ondelete='set null'readonly=Truestring='SAT request' -
folio_numberCharreadonly=Truestring='Folio' -
has_xmlBooleandefault=Falseindex=Truereadonly=Truestring='Has XML' -
issue_dateDatetimeindex=Truereadonly=Truestring='Issue date' -
issuer_nameCharreadonly=Truestring='Issuer name' -
issuer_rfcCharindex=Truereadonly=Truestring='Issuer RFC' -
receiver_nameCharreadonly=Truestring='Receiver name' -
receiver_rfcCharindex=Truereadonly=Truestring='Receiver RFC' -
sat_statusSelectionindex=Truereadonly=Trueselection=[('valid', 'Valid'), ('cancelled', 'Cancelled'), ('in_progress', 'In progress')]string='SAT status' -
seriesCharreadonly=True -
stamp_dateDatetimereadonly=Truestring='Stamp date' -
totalFloatdigits=(16, 6)readonly=True -
uuidCharindex=Truereadonly=Truerequired=Truestring='UUID' -
voucher_typeCharindex=Truereadonly=Truestring='Voucher type'
-
action_download_xml(self) -
create(self, vals_list)@api.model_create_multi -
get_formview_action(self, access_uid=None)Always open SAT documents in readonly mode (list, menu, x2many). -
unlink(self) -
write(self, vals)
New fields (4)
-
company_idMany2oneindex=Truerelated='request_id.company_id'store=True -
request_idMany2one → l10n_mx_sat.download.requestcomodel_name='l10n_mx_sat.download.request'ondelete='cascade'required=Truestring='SAT request' -
sat_package_idCharreadonly=Truerequired=Truestring='Package ID' -
stateSelectiondefault='pending'readonly=Truerequired=Trueselection=[('pending', 'Pending'), ('processed', 'Processed'), ('error', 'Error')]
No public methods.
New fields (17)
-
can_retryBooleancompute='_compute_can_retry'string='Can retry' -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>index=Truerequired=Truestring='Company' -
date_fromDatetimerequired=Truestring='From' -
date_toDatetimerequired=Truestring='To' -
directionSelectiondefault='received'index=Truerequired=Trueselection=[('issued', 'Issued'), ('received', 'Received')] -
document_countIntegerreadonly=Truestring='Processed documents' -
document_idsOne2many → l10n_mx_sat.documentcomodel_name='l10n_mx_sat.document'inverse_name='download_request_id'readonly=Truestring='Documents' -
document_kindSelectiondefault='cfdi'index=Truerequired=Trueselection=[('cfdi', 'CFDI'), ('retention', 'Retention')]string='Document kind' -
error_messageTextreadonly=Truestring='Error message' -
nameCharcompute='_compute_name'store=Truestring='Description' -
next_process_atDatetimehelp='Earliest datetime when the cron should verify this request again after the SAT accepted it but has not finished processing.'index=Truereadonly=Truestring='Next process at' -
package_idsOne2many → l10n_mx_sat.download.packagecomodel_name='l10n_mx_sat.download.package'inverse_name='request_id'readonly=Truestring='Packages' -
reported_cfdi_countIntegerreadonly=Truestring='SAT reported CFDIs' -
request_fingerprintCharindex=Truereadonly=Truestring='Request fingerprint' -
request_typeSelectiondefault='xml'index=Truerequired=Trueselection=[('xml', 'XML'), ('metadata', 'Metadata')]string='Request type' -
sat_request_idCharreadonly=Truestring='SAT request ID' -
stateSelectiondefault='draft'index=Truereadonly=Truerequired=Trueselection=[('draft', 'Draft'), ('requested', 'Requested'), ('processing', 'Processing'), ('ready', 'Ready'), ('downloading', 'Downloading'), ('done', 'Completed'), ('error', 'Error')]
-
action_queue(self)Enqueue draft requests for background processing. -
action_retry(self)Retry a failed SAT download request from the appropriate step. -
create(self, vals_list)@api.model_create_multi
New fields (4)
-
company_idMany2one → res.companycomodel_name='res.company'readonly=Truerequired=Truestring='Company' -
fiel_cerBinaryattachment=Falsestring='FIEL certificate (.cer)' -
fiel_keyBinaryattachment=Falsestring='FIEL private key (.key)' -
fiel_passwordChardefault=''string='FIEL password'
-
action_apply(self)Store new FIEL credentials on the company.
New fields (18)
-
l10n_mx_sat_auto_downloadBooleandefault=Truehelp='Enables daily creation and processing of bulk download requests for this company.'string='Automatic SAT download' -
l10n_mx_sat_document_countIntegercompute='_compute_l10n_mx_sat_document_count'string='SAT documents' -
l10n_mx_sat_download_cfdi_issuedBooleandefault=Truestring='Download issued CFDIs' -
l10n_mx_sat_download_cfdi_receivedBooleandefault=Truestring='Download received CFDIs' -
l10n_mx_sat_download_request_countIntegercompute='_compute_l10n_mx_sat_download_request_count'string='SAT download requests' -
l10n_mx_sat_download_retention_issuedBooleandefault=Truestring='Download issued retentions' -
l10n_mx_sat_download_retention_receivedBooleandefault=Truestring='Download received retentions' -
l10n_mx_sat_fiel_cerBinaryattachment=Falsegroups='base.group_system'string='FIEL certificate (.cer)' -
l10n_mx_sat_fiel_certificate_configuredBooleancompute='_compute_l10n_mx_sat_fiel_status'string='FIEL certificate configured' -
l10n_mx_sat_fiel_configuredBooleancompute='_compute_l10n_mx_sat_fiel_status'string='FIEL configured' -
l10n_mx_sat_fiel_keyBinaryattachment=Falsegroups='base.group_system'string='FIEL private key (.key)' -
l10n_mx_sat_fiel_key_configuredBooleancompute='_compute_l10n_mx_sat_fiel_status'string='Llave FIEL configured' -
l10n_mx_sat_fiel_passwordChargroups='base.group_system'string='FIEL password' -
l10n_mx_sat_fiel_rfcCharcompute='_compute_l10n_mx_sat_fiel_status'string='RFC FIEL' -
l10n_mx_sat_last_metadata_syncDatetimereadonly=Truestring='Last metadata sync' -
l10n_mx_sat_last_syncDatetimereadonly=Truestring='Last XML sync' -
l10n_mx_sat_metadata_sync_fromDatehelp='First metadata download starts on this date. If empty, the XML sync date is used, or the current month when that date is also empty.'string='Sync metadata from' -
l10n_mx_sat_sync_fromDatehelp='First XML download starts on this date. Leave empty to sync only the current month. Later downloads continue from the last completed range, one calendar month at a time.'string='Sync documents from'
-
action_l10n_mx_sat_open_fiel_wizard(self)Open wizard to upload new FIEL credentials. -
action_l10n_mx_sat_view_documents(self) -
action_l10n_mx_sat_view_download_requests(self) -
l10n_mx_sat_get_client(self)Factory: return a SatClient instance. -
l10n_mx_sat_get_credentials(self)Return decoded FIEL credentials. -
l10n_mx_sat_get_rfc(self, client=None)Return the RFC used for SAT download requests. -
l10n_mx_sat_get_token(self)Authenticate with the SAT and return a token. -
l10n_mx_sat_get_xml_download_flows(self)Return enabled XML download flows for this company. -
l10n_mx_sat_has_credentials(self) -
l10n_mx_sat_sync_now(self)Manual trigger for SAT download and metadata sync. -
l10n_mx_sat_test_connection(self)Button to test the SAT connection. -
write(self, vals)
Loading…
Loading…