TIP: You can type at any time to perform a new search.

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
OCA/l10n-brazil:
OCA/product-attribute:
OCA/queue:
odoo/odoo:
- web
- bus
- uom
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 info_outline

Views touched (13)
XML IDNameModelTypeStatus
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)HandlerAuthTypeMethodsFlags
/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_key Char
    help='Access Key of the electronic fiscal document to be searched.'
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> string='Company'
  • fiscal_type Selection
    required=True selection=[('nfe', 'NF-e'), ('cte', 'CT-e')]
  • nsu Char
    help='NSU (Numero Sequencial Unico) is a unique sequential number assigned to each document in the Brazilian electronic fiscal document system.' string='NSU'
  • search_type Selection
    default='access_key' required=True selection=[('access_key', 'Search by Access Key'), ('nsu', 'Search by NSU')]
Public methods (1)
  • action_confirm_search(self)

New fields (12)
  • access_key Char
    index=True size=44
  • attachment_id Many2one → ir.attachment
    comodel_name='ir.attachment' help='XML Attachment stored in Odoo.'
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> readonly=True string='Company'
  • dfe_document_id Many2one → l10n_br_fiscal_dfe.document
    comodel_name='l10n_br_fiscal_dfe.document' string='DF-e Document'
  • document_type_dfe Selection
    selection=[('complete', 'Complete'), ('summary', 'Summary'), ('event', 'Event')] string='DF-e Type'
  • event_type_dfe Char
    string='Event Type'
  • event_type_dfe_label Char
    compute='_compute_event_type_dfe_label' string='Event'
  • fiscal_type Selection
    index=True selection=[('nfe', 'NF-e'), ('cte', 'CT-e')]
  • nsu Char
    index=True size=25 string='NSU'
  • operation_type Selection
    selection=OPERATION_TYPE
  • schema_type Char
    help='Type of the DF-e document according to the XML schema.'
  • xml_pretty Text
    compute='_compute_xml_pretty' string='XML Pretty'
Public methods (2)
  • action_download_xml(self)
  • create_xml_attachment(self, xml)

New fields (6)
  • company_id Many2one → res.company
    comodel_name='res.company' index=True readonly=True required=True
  • fiscal_type Selection
    index=True readonly=True selection=[('nfe', 'NF-e'), ('cte', 'CT-e')]
  • log_type Selection
    default='info' readonly=True required=True selection=[('success', 'Success'), ('info', 'Info'), ('warning', 'Warning'), ('error', 'Error')]
  • message Text
    readonly=True required=True
  • request_xml Text
    help='SOAP envelope sent to SEFAZ' readonly=True string='SOAP Request'
  • response_xml Text
    help='SOAP envelope received from SEFAZ' readonly=True string='SOAP Response'
Public methods (0)

No public methods.

New fields (16)
  • access_key Char
    index=True required=True size=44
  • color_status Selection
    compute='_compute_color_status' store=True args: [('green', 'Complete'), ('blue', 'Summary'), ('muted', 'Cancelled/Denied')]
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> index=True required=True
  • currency_id Many2one → res.currency
    comodel_name='res.currency' default=<expr>
  • dfe_ids One2many → l10n_br_fiscal_dfe.dfe
    comodel_name='l10n_br_fiscal_dfe.dfe' inverse_name='dfe_document_id' string='DF-e records'
  • document_amount Monetary
    string='Document Total Value'
  • document_emission_date Datetime
    string='Emission Date'
  • document_number Char
    size=18
  • document_state Char
    help='Document situation code as received from the distribution service (semantics depend on the fiscal document type).' string='State Code'
  • document_state_label Char
    compute='_compute_document_state_label' string='State'
  • emitter Char
    size=60
  • fiscal_type Selection
    index=True selection=[('nfe', 'NF-e'), ('cte', 'CT-e')]
  • is_own_document Boolean
    compute='_compute_is_own_document' help='True when the emitter CNPJ in the access key matches the company CNPJ.' store=True string='Own Document'
  • partner_id Many2one → res.partner
    comodel_name='res.partner' compute='_compute_partner_id' store=True string='Partner'
  • serie Char
    size=3
  • vat Char
    size=18 string='CNPJ/CPF'
Public methods (5)
  • 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_notification Boolean
    help='Receive Inbox notifications when the DF-e distribution finds new third-party documents.' string='DF-e Notification'
Public methods (2)
  • SELF_READABLE_FIELDS(self)
    @property
  • SELF_WRITEABLE_FIELDS(self)
    @property

Loading…

Loading…

Loading…

Loading…