TIP: You can type at any time to perform a new search.
Brazilian Localization CNPJ Search
l10n_br_cnpj_search · OCA/l10n-brazil
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
- 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    ## SERPRO   ## 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
Views touched (4)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
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_idMany2one → res.currencycomodel_name='res.currency'default=<expr>readonly=Truestring='BR Company Currency' -
cnae_main_idMany2one → l10n_br_fiscal.cnaecomodel_name='l10n_br_fiscal.cnae' -
cnpj_branch_typeSelectionhelp='Whether the establishment is the head office or a branch.'selection=CNPJ_BRANCH_TYPE_SELECTIONstring='Head Office / Branch' -
cnpj_statusCharhelp='Registration status of the CNPJ (e.g. Active).'string='CNPJ Status' -
cnpj_status_dateDatehelp='Date of the current registration status.'string='CNPJ Status Date' -
cnpj_status_reasonCharhelp='Reason for the current registration status.'string='CNPJ Status Reason' -
company_sizeCharhelp='Company size classification (e.g. Small Business).' -
equity_capitalMonetarycurrency_field='br_currency_id' -
legal_nature_idMany2one → l10n_br_fiscal.legal.naturecomodel_name='l10n_br_fiscal.legal.nature'string='Legal Nature' -
legal_responsible_functionCharhelp='Function of the legal responsible for the company.' -
legal_responsible_nameCharhelp='Name of the legal responsible for the company.'string='Legal Responsible' -
opening_dateDatehelp='Date the company started its activities.' -
simples_option_dateDatehelp='Date the company opted for the Simples Nacional regime.'string='Simples Nacional Option Date'
-
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.modelBuild 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.modelGet webservice endpoint Params: cnpj (str): Partner CNPJ. -
get_data(self, data, name, title=False, lower=False)@api.model -
get_headers(self)@api.modelGet webservice request headers -
get_provider(self)@api.modelReturn selected provider in config -
import_data(self, data)@api.modelImport 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.modelValidate webservice response. Returns: data (dict)
New fields (33)
-
child_idsMany2many → res.partnercolumn1='parent_id'column2='wizard_id'comodel_name='res.partner'relation='parent_id_wizard_id' -
city_idMany2one → res.citycomodel_name='res.city'domain="[('state_id', '=', state_id)]" -
cnae_main_idMany2one → l10n_br_fiscal.cnaecomodel_name='l10n_br_fiscal.cnae' -
cnae_secondary_idsMany2many → l10n_br_fiscal.cnaecolumn1='company_id'column2='cnae_id'comodel_name='l10n_br_fiscal.cnae'relation='wizard_fiscal_cnae_rel' -
cnpj_branch_typeSelectionselection=CNPJ_BRANCH_TYPE_SELECTION -
cnpj_card_pdfBinaryattachment=False -
cnpj_statusChar -
cnpj_status_dateDate -
cnpj_status_reasonChar -
company_sizeChar -
country_idMany2one → res.countrycomodel_name='res.country' -
currency_idMany2one → res.currencycomodel_name='res.currency'default=<expr> -
districtChar -
emailChar -
equity_capitalMonetarycurrency_field='currency_id' -
l10n_br_ie_codeChar -
legal_nameChar -
legal_nature_idMany2one → l10n_br_fiscal.legal.naturecomodel_name='l10n_br_fiscal.legal.nature' -
legal_responsible_functionChar -
legal_responsible_nameChar -
nameChar -
opening_dateDate -
partner_idMany2one → res.partnercomodel_name='res.partner' -
phoneChar -
provider_nameChar -
simples_option_dateDate -
state_idMany2one → res.country.statecomodel_name='res.country.state' -
street2Char -
street_nameChar -
street_numberChar -
tax_frameworkSelectionselection=TAX_FRAMEWORK -
vatCharstring='CNPJ' -
zipChar
-
action_update_partner(self) -
default_get(self, fields)
New fields (3)
-
company_currency_idMany2one → res.currencyreadonly=Truerelated='currency_id'string='Company Currency' args: 'res.currency' -
company_typeSelectionrelated='partner_id.company_type' -
equity_capitalMonetaryrelated='partner_id.equity_capital'
No public methods.
New fields (9)
-
cnpj_providerSelectionconfig_parameter='l10n_br_cnpj_search.cnpj_provider'default='receitaws'required=Trueselection=[('receitaws', 'ReceitaWS'), ('serpro', 'SERPRO'), ('cpfcnpj', 'CPF.CNPJ')]string='CNPJ Search Provider' -
cpfcnpj_fetch_ieBooleanconfig_parameter='l10n_br_cnpj_search.cpfcnpj_fetch_ie'default=Falsestring='CPF.CNPJ: fetch state registration (package 16)' -
cpfcnpj_packageSelectionconfig_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_cardBooleanconfig_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_partnersBooleanconfig_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_tokenCharconfig_parameter='l10n_br_cnpj_search.cpfcnpj_token'string='CPF.CNPJ Token' -
serpro_schemaSelectionconfig_parameter='l10n_br_cnpj_search.serpro_schema'selection=[('basica', 'Básica'), ('qsa', 'QSA'), ('empresa', 'Empresa')]string='SERPRO Schema' -
serpro_tokenCharconfig_parameter='l10n_br_cnpj_search.serpro_token'string='SERPRO Token' -
serpro_trialBooleanconfig_parameter='l10n_br_cnpj_search.serpro_trial'string='Use SERPRO Trial'
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)