TIP: You can type at any time to perform a new search.
Monitor de DF-e (Base)
l10n_br_fiscal_dfe · OCA/l10n-brazil
Security findings
- Repository
- OCA/l10n-brazil · module folder · Try on Runboat
- Module version
- Category
- Uncategorized
- Folder size
- 0.19 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/l10n-brazil
- Last tracking update
- 2026-09-29 07:15:28
- Authors
- Odoo Community Association (OCA), KMEE, Engenere
- Maintainers
- Odoo Community Association (OCA), KMEE, Engenere
- Committers
- Raphaël Valyi, Weblate, Luis Felipe Mileo, OCA-git-bot, oca-ci, CristianoMafraJunior
- Odoo dependencies
- Python dependencies
- erpbrasil-base>=2.4.2, email-validator, num2words, phonenumbers, requests
- System dependencies
- None
- Required by
- l10n_br_nfe_dfe
- Description
Framework genérico para monitoramento de documentos fiscais eletrônicos recebidos via os web services de Distribuição de DF-e da SEFAZ (Ambiente Nacional). Este módulo é **agnóstico ao tipo de documento fiscal**: ele implementa toda a lógica comum de distribuição DF-e — paginação de NSUs, agendamento inteligente baseado na resposta da SEFAZ (138, 137, 656), desduplicação, notificações, logs SOAP e o painel (banner) — parametrizado por tipo de documento (`fiscal_type`). Os módulos específicos implementam apenas o que é particular de cada documento fiscal: - `l10n_br_nfe_dfe` — DF-e de NF-e (NFeDistribuicaoDFe, [NT 2014.002](https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=P0U3lU1Fe40=)) - `l10n_br_cte_dfe` — DF-e de CT-e (CTeDistribuicaoDFe) — futuro Funcionalidades genéricas: - **Motor de distribuição** em `res.company`, parametrizado por `fiscal_type` (campos `{fiscal_type}_last_nsu`, `{fiscal_type}_max_nsu`, `{fiscal_type}_dfe_last_query`, etc. definidos pelos módulos específicos) - **Modelos genéricos**: `l10n_br_fiscal_dfe.dfe` (payload XML por NSU) e `l10n_br_fiscal_dfe.document` (documento agrupado por chave de acesso) - **Consulta manual** — assistente de busca específica por chave de acesso (com validação do dígito verificador) ou por NSU - **Painel (banner)** genérico exibido nas visões dos módulos específicos via `banner_route` - **Notificações no Inbox** — notifica usuários sobre novos documentos de terceiros (preferência por usuário) - **Matching automático de parceiro** pelo CNPJ da chave de acesso - **Log de distribuição** com request/response SOAP para depuração - **Suporte multi-empresa** com record rules - **Canal queue_job** `root.dfe` para as consultas automáticas
Code Analysis
Views touched (13)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
dfe_distribution_log_form |
dfe.distribution.log.form | l10n_br_fiscal_dfe.distribution_log | form | New |
dfe_distribution_log_search |
dfe.distribution.log.search | l10n_br_fiscal_dfe.distribution_log | search | New |
dfe_distribution_log_tree |
dfe.distribution.log.tree | l10n_br_fiscal_dfe.distribution_log | list | New |
dfe_document_banner |
DF-e Document Banner | ir.ui.view | qweb | New |
dfe_form |
l10n_br_fiscal_dfe.dfe.form | l10n_br_fiscal_dfe.dfe | form | New |
dfe_res_company_form |
dfe.res.company.form | res.company | form | Inherits l10n_br_fiscal.fiscal_res_company_form |
dfe_tree |
l10n_br_fiscal_dfe.dfe.tree | l10n_br_fiscal_dfe.dfe | list | New |
l10n_br_fiscal_dfe_document_form |
l10n_br_fiscal_dfe.document.form | l10n_br_fiscal_dfe.document | form | New |
l10n_br_fiscal_dfe_document_search |
l10n_br_fiscal_dfe.document.search | l10n_br_fiscal_dfe.document | search | New |
l10n_br_fiscal_dfe_document_tree |
l10n_br_fiscal_dfe.document.tree | l10n_br_fiscal_dfe.document | list | New |
view_dfe_specific_search_wizard_form |
dfe.specific.search.wizard.form | dfe.specific.search.wizard | form | New |
view_users_form_dfe |
res.users.form.dfe | res.users | form | Inherits base.view_users_form |
view_users_form_simple_modif_dfe |
res.users.preferences.form.dfe | res.users | form | Inherits base.view_users_form_simple_modif |
HTTP endpoints (1)
| Route(s) | Handler | Auth | Type | Methods | Flags |
|---|---|---|---|---|---|
/l10n_br_fiscal_dfe/document_banner, /l10n_br_fiscal_dfe/document_banner/<string:fiscal_type> |
DfeDocumentBannerController.document_banner |
user | json | ALL |
Models touched (6)
New fields (5)
-
access_keyCharhelp='Access Key of the electronic fiscal document to be searched.' -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>string='Company' -
fiscal_typeSelectionrequired=Trueselection=[('nfe', 'NF-e'), ('cte', 'CT-e')] -
nsuCharhelp='NSU (Numero Sequencial Unico) is a unique sequential number assigned to each document in the Brazilian electronic fiscal document system.'string='NSU' -
search_typeSelectiondefault='access_key'required=Trueselection=[('access_key', 'Search by Access Key'), ('nsu', 'Search by NSU')]
-
action_confirm_search(self)
New fields (12)
-
access_keyCharindex=Truesize=44 -
attachment_idMany2one → ir.attachmentcomodel_name='ir.attachment'help='XML Attachment stored in Odoo.' -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>readonly=Truestring='Company' -
dfe_document_idMany2one → l10n_br_fiscal_dfe.documentcomodel_name='l10n_br_fiscal_dfe.document'string='DF-e Document' -
document_type_dfeSelectionselection=[('complete', 'Complete'), ('summary', 'Summary'), ('event', 'Event')]string='DF-e Type' -
event_type_dfeCharstring='Event Type' -
event_type_dfe_labelCharcompute='_compute_event_type_dfe_label'string='Event' -
fiscal_typeSelectionindex=Trueselection=[('nfe', 'NF-e'), ('cte', 'CT-e')] -
nsuCharindex=Truesize=25string='NSU' -
operation_typeSelectionselection=OPERATION_TYPE -
schema_typeCharhelp='Type of the DF-e document according to the XML schema.' -
xml_prettyTextcompute='_compute_xml_pretty'string='XML Pretty'
-
action_download_xml(self) -
create_xml_attachment(self, xml)
New fields (6)
-
company_idMany2one → res.companycomodel_name='res.company'index=Truereadonly=Truerequired=True -
fiscal_typeSelectionindex=Truereadonly=Trueselection=[('nfe', 'NF-e'), ('cte', 'CT-e')] -
log_typeSelectiondefault='info'readonly=Truerequired=Trueselection=[('success', 'Success'), ('info', 'Info'), ('warning', 'Warning'), ('error', 'Error')] -
messageTextreadonly=Truerequired=True -
request_xmlTexthelp='SOAP envelope sent to SEFAZ'readonly=Truestring='SOAP Request' -
response_xmlTexthelp='SOAP envelope received from SEFAZ'readonly=Truestring='SOAP Response'
No public methods.
New fields (16)
-
access_keyCharindex=Truerequired=Truesize=44 -
color_statusSelectioncompute='_compute_color_status'store=True args: [('green', 'Complete'), ('blue', 'Summary'), ('muted', 'Cancelled/Denied')] -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>index=Truerequired=True -
currency_idMany2one → res.currencycomodel_name='res.currency'default=<expr> -
dfe_idsOne2many → l10n_br_fiscal_dfe.dfecomodel_name='l10n_br_fiscal_dfe.dfe'inverse_name='dfe_document_id'string='DF-e records' -
document_amountMonetarystring='Document Total Value' -
document_emission_dateDatetimestring='Emission Date' -
document_numberCharsize=18 -
document_stateCharhelp='Document situation code as received from the distribution service (semantics depend on the fiscal document type).'string='State Code' -
document_state_labelCharcompute='_compute_document_state_label'string='State' -
emitterCharsize=60 -
fiscal_typeSelectionindex=Trueselection=[('nfe', 'NF-e'), ('cte', 'CT-e')] -
is_own_documentBooleancompute='_compute_is_own_document'help='True when the emitter CNPJ in the access key matches the company CNPJ.'store=Truestring='Own Document' -
partner_idMany2one → res.partnercomodel_name='res.partner'compute='_compute_partner_id'store=Truestring='Partner' -
serieCharsize=3 -
vatCharsize=18string='CNPJ/CPF'
-
action_download_xml(self) -
action_download_xmls_zip(self)Download complete XMLs of selected documents as a zip file. -
action_match_partner(self)Re-run the partner matching logic -
import_document(self)Import the document into the fiscal system. Must be implemented by fiscal type specific modules (e.g., l10n_br_nfe_dfe for NF-e, l10n_br_cte_dfe for CT-e). -
make_pdf(self)Generate a PDF representation of the document. Must be implemented by fiscal type specific modules (e.g., l10n_br_nfe_dfe for NF-e, l10n_br_cte_dfe for CT-e).
New fields (0)
No new fields.
Public methods (3)-
action_document_distribution(self, fiscal_type) -
action_search_specific(self, fiscal_type) -
dfe_search_documents(self, fiscal_type)
New fields (1)
-
dfe_notificationBooleanhelp='Receive Inbox notifications when the DF-e distribution finds new third-party documents.'string='DF-e Notification'
-
SELF_READABLE_FIELDS(self)@property -
SELF_WRITEABLE_FIELDS(self)@property
Loading…
Loading…
Loading…
Loading…