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.49 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/l10n-brazil
Last tracking update
2026-09-19 23:36:06
Authors
Odoo Community Association (OCA), KMEE
Maintainers
Odoo Community Association (OCA), KMEE
Committers
Raphaël Valyi, Weblate, OCA-git-bot, oca-ci, CristianoMafraJunior
Odoo dependencies
OCA/l10n-brazil:
OCA/product-attribute:
odoo/odoo:
- web
- bus
- uom
Python dependencies
erpbrasil-base>=2.4.2, brazilcep, email-validator, num2words, phonenumbers
System dependencies
None
Required by
l10n_br_crm_cnpj_search
Description
Módulo que adiciona um botão para preencher automaticamente os campos de
um partner a partir do seu CNPJ. Seguem abaixo os campos que podem ser
consultados de ambas as APIs utilizadas para conseguir informações a
partir do CNPJ:

## ReceitaWS

![](../static/description/receita.png)

![](../static/description/receita1.png)

![](../static/description/receita2.png)

## SERPRO

![](../static/description/serpro.png)

![](../static/description/serpro1.png)

## CPF.CNPJ (cpfcnpj.com.br)

Provedor comercial com dados em tempo real, vindos da Receita Federal no
momento da consulta (D+0). O pacote 5 (CNPJ B) é a opção mais leve
(cadastro e endereço, sem sócios e sem PDF), enquanto o pacote 6 (CNPJ D)
traz o cadastro completo.

Do pacote 6, o módulo preenche no partner: razão social, nome fantasia,
endereço completo, telefones, e-mail, natureza jurídica, capital social,
CNAE principal e secundários, porte da empresa, situação cadastral (com
data e motivo), data de abertura, matriz ou filial, data de opção pelo
Simples Nacional e responsável perante a Receita (nome e qualificação). A
partir do Simples Nacional, SIMEI e porte, o módulo também alimenta o
`tax_framework` (regime tributário) do partner, campo que os demais
provedores não preenchem hoje.

Cada sócio do Quadro de Sócios e Administradores vira um contato filho e
o Cartão CNPJ em PDF da Receita Federal fica anexado ao parceiro; as
opções "CPF.CNPJ: do not import partners (QSA)" e "CPF.CNPJ: do not attach
the CNPJ card PDF" desligam cada um desses passos. A opção "CPF.CNPJ: fetch state registration (package
16)" (desligada por padrão) faz uma consulta ao pacote 16 (CNPJ H) para
trazer a Inscrição Estadual da UF do endereço.

O provedor mantém as certificações ISO/IEC 27001, ISO/IEC 27701 e ISO
37301. A documentação da API está disponível em
https://www.cpfcnpj.com.br/dev/.

Code Analysis info_outline

Views touched (4)
XML IDNameModelTypeStatus
l10n_br_cnpj_search_fiscal_company_form l10n_br_fiscal.company.form (in l10n_br_cnpj_search) res.company form Inherits l10n_br_fiscal.fiscal_res_company_form
l10n_br_cnpj_search_fiscal_partner_form l10n_br_fiscal.partner.form (in l10n_br_cnpj_search) res.partner form Inherits l10n_br_fiscal.partner_form
l10n_br_cnpj_search_res_config_settings_form res.config.settings.form (in l10n_br_cnpj_search) res.config.settings form Inherits l10n_br_base.l10n_br_base_res_config_settings_form
res_partner_wizard_view res_partner_wizard partner.search.wizard form New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (6)

New fields (13)
  • br_currency_id Many2one → res.currency
    comodel_name='res.currency' default=<expr> readonly=True string='BR Company Currency'
  • cnae_main_id Many2one → l10n_br_fiscal.cnae
    comodel_name='l10n_br_fiscal.cnae'
  • cnpj_branch_type Selection
    help='Whether the establishment is the head office or a branch.' selection=CNPJ_BRANCH_TYPE_SELECTION string='Head Office / Branch'
  • cnpj_status Char
    help='Registration status of the CNPJ (e.g. Active).' string='CNPJ Status'
  • cnpj_status_date Date
    help='Date of the current registration status.' string='CNPJ Status Date'
  • cnpj_status_reason Char
    help='Reason for the current registration status.' string='CNPJ Status Reason'
  • company_size Char
    help='Company size classification (e.g. Small Business).'
  • equity_capital Monetary
    currency_field='br_currency_id'
  • legal_nature_id Many2one → l10n_br_fiscal.legal.nature
    comodel_name='l10n_br_fiscal.legal.nature' string='Legal Nature'
  • legal_responsible_function Char
    help='Function of the legal responsible for the company.'
  • legal_responsible_name Char
    help='Name of the legal responsible for the company.' string='Legal Responsible'
  • opening_date Date
    help='Date the company started its activities.'
  • simples_option_date Date
    help='Date the company opted for the Simples Nacional regime.' string='Simples Nacional Option Date'
Public methods (2)
  • action_open_cnpj_search_wizard(self)
  • cnpj_validation_disabled(self)
    @api.model

New fields (0)

No new fields.

Public methods (15)
  • cpfcnpj_get_api_url(self, cnpj, package=None)
    @api.model
    Build the provider endpoint. The optional package argument overrides the configured package, which is used to reach the state registration package (16) without changing the configured default. When omitted, the configured package is used.
  • cpfcnpj_get_headers(self)
    @api.model
  • cpfcnpj_validate(self, response)
    @api.model
  • get_api_url(self, cnpj)
    @api.model
    Get webservice endpoint Params: cnpj (str): Partner CNPJ.
  • get_data(self, data, name, title=False, lower=False)
    @api.model
  • get_headers(self)
    @api.model
    Get webservice request headers
  • get_provider(self)
    @api.model
    Return selected provider in config
  • import_data(self, data)
    @api.model
    Import webservice response to Odoo Params: data (dict): data with webservice response Returns: values (dict): dict with res_partner fields and it's values
  • receitaws_get_api_url(self, cnpj)
    @api.model
  • receitaws_get_headers(self)
    @api.model
  • receitaws_validate(self, response)
    @api.model
  • serpro_get_api_url(self, cnpj)
    @api.model
  • serpro_get_headers(self)
    @api.model
  • serpro_validate(self, response)
    @api.model
  • validate(self, response)
    @api.model
    Validate webservice response. Returns: data (dict)

New fields (33)
  • child_ids Many2many → res.partner
    column1='parent_id' column2='wizard_id' comodel_name='res.partner' relation='parent_id_wizard_id'
  • city_id Many2one → res.city
    comodel_name='res.city' domain="[('state_id', '=', state_id)]"
  • cnae_main_id Many2one → l10n_br_fiscal.cnae
    comodel_name='l10n_br_fiscal.cnae'
  • cnae_secondary_ids Many2many → l10n_br_fiscal.cnae
    column1='company_id' column2='cnae_id' comodel_name='l10n_br_fiscal.cnae' relation='wizard_fiscal_cnae_rel'
  • cnpj_branch_type Selection
    selection=CNPJ_BRANCH_TYPE_SELECTION
  • cnpj_card_pdf Binary
    attachment=False
  • cnpj_status Char
  • cnpj_status_date Date
  • cnpj_status_reason Char
  • company_size Char
  • country_id Many2one → res.country
    comodel_name='res.country'
  • currency_id Many2one → res.currency
    comodel_name='res.currency' default=<expr>
  • district Char
  • email Char
  • equity_capital Monetary
    currency_field='currency_id'
  • l10n_br_ie_code Char
  • legal_name Char
  • legal_nature_id Many2one → l10n_br_fiscal.legal.nature
    comodel_name='l10n_br_fiscal.legal.nature'
  • legal_responsible_function Char
  • legal_responsible_name Char
  • name Char
  • opening_date Date
  • partner_id Many2one → res.partner
    comodel_name='res.partner'
  • phone Char
  • provider_name Char
  • simples_option_date Date
  • state_id Many2one → res.country.state
    comodel_name='res.country.state'
  • street2 Char
  • street_name Char
  • street_number Char
  • tax_framework Selection
    selection=TAX_FRAMEWORK
  • vat Char
    string='CNPJ'
  • zip Char
Public methods (2)
  • action_update_partner(self)
  • default_get(self, fields)

New fields (3)
  • company_currency_id Many2one → res.currency
    readonly=True related='currency_id' string='Company Currency' args: 'res.currency'
  • company_type Selection
    related='partner_id.company_type'
  • equity_capital Monetary
    related='partner_id.equity_capital'
Public methods (0)

No public methods.

New fields (9)
  • cnpj_provider Selection
    config_parameter='l10n_br_cnpj_search.cnpj_provider' default='receitaws' required=True selection=[('receitaws', 'ReceitaWS'), ('serpro', 'SERPRO'), ('cpfcnpj', 'CPF.CNPJ')] string='CNPJ Search Provider'
  • cpfcnpj_fetch_ie Boolean
    config_parameter='l10n_br_cnpj_search.cpfcnpj_fetch_ie' default=False string='CPF.CNPJ: fetch state registration (package 16)'
  • cpfcnpj_package Selection
    config_parameter='l10n_br_cnpj_search.cpfcnpj_package' default='6' selection=[('5', '5 - Cadastro e endereço'), ('6', '6 - Cadastro completo (Simples Nacional, porte e situação)')] string='CPF.CNPJ Package'
  • cpfcnpj_skip_card Boolean
    config_parameter='l10n_br_cnpj_search.cpfcnpj_skip_card' help='By default the CNPJ card PDF returned by package 6 is attached to the partner. Enable this to skip that step.' string='CPF.CNPJ: do not attach the CNPJ card PDF'
  • cpfcnpj_skip_partners Boolean
    config_parameter='l10n_br_cnpj_search.cpfcnpj_skip_partners' help='By default each partner from the QSA becomes a child contact. Enable this to skip that step.' string='CPF.CNPJ: do not import partners (QSA)'
  • cpfcnpj_token Char
    config_parameter='l10n_br_cnpj_search.cpfcnpj_token' string='CPF.CNPJ Token'
  • serpro_schema Selection
    config_parameter='l10n_br_cnpj_search.serpro_schema' selection=[('basica', 'Básica'), ('qsa', 'QSA'), ('empresa', 'Empresa')] string='SERPRO Schema'
  • serpro_token Char
    config_parameter='l10n_br_cnpj_search.serpro_token' string='SERPRO Token'
  • serpro_trial Boolean
    config_parameter='l10n_br_cnpj_search.serpro_trial' string='Use SERPRO Trial'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
checks failing
Open since
4 days ago
Last activity
4 days ago
Repository
OCA/l10n-brazil
Pull request
[20.0][MIG] l10n_br_cnpj_search: Migration to 20.0 (#5261)