NFS-e (FocusNFE)
l10n_br_nfse_focus · OCA/l10n-brazil
-
Security10/251 grave, 0 minor
-
Activity25/25Human commit this month
-
Required by5/250 modules depend on it
-
Maturity25/25In 5 Odoo series since 14.0
Heuristic over the facts below, not an audit · How it's computed
Security warnings
res.company— Adds credential fields (focusnfe_homologation_token, focusnfe_production_token) with no `groups=` to 'res.company', which every user (portal/public included) can read under core's access rights: they can read them over RPC. Restrict the fields with `groups=` (e.g. base.group_system). CWE-200. acl-public-read-secret
Found by automated static analysis: these patterns are usually risky, but only a manual review of the module can confirm a real issue. Methodology
Description
Esse módulo integra a emissão de Notas Fiscais de Serviços (NFSe) com a API da FocusNFE permitindo assim, a criação, transmissão, consulta e cancelamento de documentos fiscais do tipo NFSe.
O módulo suporta dois tipos de emissão:
- NFSe Municipal: Emissão de NFSe através da API municipal da FocusNFE
- NFSe Nacional: Emissão de NFSe através da API nacional da FocusNFE
Para mais informações, acesse: https://focusnfe.com.br/
Dependencies
- Odoo dependencies
- Python dependencies
- erpbrasil-base>=2.4.2, erpbrasil.edoc, erpbrasil.transmissao, transitions, erpbrasil-base>=2.5.0, email-validator, num2words, phonenumbers, erpbrasil.assinatura
- System dependencies
- None
- Required by
- None
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 1
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
focus_nfse_res_company_form |
l10n_br_fiscal.res.company.form (in l10n_br_nfse_focus) | res.company | form | Inherits l10n_br_nfse.nfse_res_company_form |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 3
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (4)-
cancel_document_focus(self)Cancel a NFSe document with the Focus NFSe provider. Parameters: None. Returns: The response regarding the cancellation request. -
create_cancel_event(self, status_json, record)Create a cancel event and process it. Parameters: record: The NFSe record that is being canceled. Returns: The created event. -
fetch_and_verify_pdf_content(self, status_json, record)Fetch and verify the PDF content from the provided URL. Parameters: status_json: JSON response containing the URLs for the PDF. record: The NFSe record for which the PDF is being retrieved. Returns: None. Updates the record with the PDF content if valid. -
make_focus_nfse_pdf(self, content)Generate a PDF for a NFSe document using Focus NFSe service. Parameters: - content: The binary content of the PDF to be attached. Returns: None. Creates or updates an 'ir.attachment' record with the PDF content.
-
focusnfe_homologation_tokenCharstring='FocusNFe Homologation Token' -
focusnfe_nfse_cnae_code_valueSelectiondefault='codigo_cnae'string='NFSE CNAE Code Value' args: [('codigo_cnae', 'CNAE Code'), ('codigo_tributacao_municipio', 'City Taxation Code')] -
focusnfe_nfse_force_odoo_danfseBooleandefault=Falsehelp='If checked, the system will always use the Odoo DANFSE instead of the Focus DANFSE.'string='Force Odoo DANFSE' -
focusnfe_nfse_nacional_concat_lines_discriminacaoBooleandefault=Falsehelp='If checked, the Discriminação do Serviço sent to NFSe Nacional will concatenate the description of every fiscal line in the document, instead of using only the description of the first line.'string='Concatenate All Lines in Discriminação (NFSe Nacional)' -
focusnfe_nfse_nacional_send_im_prestadorBooleandefault=Truestring='Send Provider Municipal Registration (NFSe Nacional)' -
focusnfe_nfse_service_type_valueSelectiondefault='item_lista_servico'string='NFSE Service Type Value' args: [('item_lista_servico', 'Service Type'), ('codigo_tributacao_municipio', 'City Taxation Code'), ('codigo_tributacao_nacional', 'National Taxation Code')] -
focusnfe_nfse_typeSelectiondefault='nfse'help='Select whether to use NFSe (municipal) or NFSe Nacional (national) API'string='FocusNFe NFSe Type' args: [('nfse', 'NFSe'), ('nfse_nacional', 'NFSe Nacional')] -
focusnfe_nfse_update_authorized_document_statusBooleandefault=Falsehelp='If checked, authorized documents will be included in the status check wizard. The system will verify the status of the documents with Focus NFE, and if there are discrepancies with the status in Odoo, it will automatically update the status in the system.'string='Include Authorized Documents in Status Check' -
focusnfe_production_tokenCharstring='FocusNFe Production Token' -
focusnfe_tax_rate_formatSelectiondefault='decimal' args: [('decimal', 'Decimal'), ('percentage', 'Percentage')] -
provedor_nfseSelectionselection_add=[('focusnfe', 'FocusNFe')]
-
get_focusnfe_token(self)Retrieve the appropriate FocusNFe API token based on the current NFSe environment setting. Decide between the production and homologation (test) environment tokens by examining the 'nfse_environment' field of the record. Precondition: - Call this method on a single record only. The method uses ensure_one to enforce this rule. Returns: - str: The FocusNFe token. Return the production token if 'nfse_environment' is set to "1"; otherwise, return the homologation token. Raises: - ValueError: If the method is called on a recordset containing more than one record.
Loading…
Loading…
Loading…
Loading…
Loading…