-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
141 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,8 @@ Brazilian Localization CRM CNPJ Search | |
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Módulo que adiciona um botão para preencher automaticamente os campos de um lead a partir do seu CNPJ. | ||
Módulo que adiciona um botão para preencher automaticamente os campos de | ||
um lead a partir do seu CNPJ. | ||
|
||
**Table of contents** | ||
|
||
|
@@ -43,17 +44,21 @@ Este módulo depende do módulo l10n_br_cnpj_search e l10n_br_crm. | |
Configuration | ||
============= | ||
|
||
Esta busca de informações a partir do cnpj é realizada com base no provedor configurado na aba de configurações, vale ressaltar que o provedor receitaws permite a realização de três consultas por minuto, enquanto que o SERPRO é pago e permite consultas ilimitadas em seus planos. | ||
Esta busca de informações a partir do cnpj é realizada com base no | ||
provedor configurado na aba de configurações, vale ressaltar que o | ||
provedor receitaws permite a realização de três consultas por minuto, | ||
enquanto que o SERPRO é pago e permite consultas ilimitadas em seus | ||
planos. | ||
|
||
Usage | ||
===== | ||
|
||
#. Acesse Configurações | ||
#. Escolha um provedor para a busca | ||
#. Habilite o Lead nas configurações do CRM | ||
#. Acesse CRM > Lead > Criar | ||
#. Preencha o nome do Lead, insira no campo de CNPJ o CNPJ que deseja buscar e clique na lupa ao lado do campo para buscar | ||
|
||
1. Acesse Configurações | ||
2. Escolha um provedor para a busca | ||
3. Habilite o Lead nas configurações do CRM | ||
4. Acesse CRM > Lead > Criar | ||
5. Preencha o nome do Lead, insira no campo de CNPJ o CNPJ que deseja | ||
buscar e clique na lupa ao lado do campo para buscar | ||
|
||
Bug Tracker | ||
=========== | ||
|
@@ -69,19 +74,19 @@ Credits | |
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
------- | ||
|
||
* KMEE | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
------------ | ||
|
||
* `KMEE <https://www.kmee.com.br>`_: | ||
- `KMEE <https://www.kmee.com.br>`__: | ||
|
||
* Bruno Corredato Botti <[email protected]> | ||
- Bruno Corredato Botti <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
----------- | ||
|
||
This module is maintained by the OCA. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Esta busca de informações a partir do cnpj é realizada com base no | ||
provedor configurado na aba de configurações, vale ressaltar que o | ||
provedor receitaws permite a realização de três consultas por minuto, | ||
enquanto que o SERPRO é pago e permite consultas ilimitadas em seus | ||
planos. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- [KMEE](https://www.kmee.com.br): | ||
- Bruno Corredato Botti \<<[email protected]>\> |
This file was deleted.
Oops, something went wrong.
3 changes: 2 additions & 1 deletion
3
...br_crm_cnpj_search/readme/DESCRIPTION.rst → ..._br_crm_cnpj_search/readme/DESCRIPTION.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Módulo que adiciona um botão para preencher automaticamente os campos de um lead a partir do seu CNPJ. | ||
Módulo que adiciona um botão para preencher automaticamente os campos de | ||
um lead a partir do seu CNPJ. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
1. Acesse Configurações | ||
2. Escolha um provedor para a busca | ||
3. Habilite o Lead nas configurações do CRM | ||
4. Acesse CRM \> Lead \> Criar | ||
5. Preencha o nome do Lead, insira no campo de CNPJ o CNPJ que deseja | ||
buscar e clique na lupa ao lado do campo para buscar |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_receitaws |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Copyright 2024 KMEE | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from unittest import mock | ||
|
||
from odoo.addons.l10n_br_cnpj_search.tests.common import ( | ||
TestCnpjCommon, | ||
) | ||
|
||
|
||
class TestCRMReceitaws(TestCnpjCommon): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
cls.crm_lead_model = cls.env["crm.lead"] | ||
cls.res_partner_model = cls.env["res.partner"] | ||
cls.crm_lead_1 = cls.crm_lead_model.create({"name": "Jamanta"}) | ||
|
||
def test_convert_to_oportunity(self): | ||
# self.crm_lead_1._onchange_cnpj_cpf() | ||
mocked_response = self.mocked_response_ws_1 | ||
mocked_response["atividades_secundarias"] = [ | ||
{ | ||
"code": "62.01-5-01", | ||
"text": "Desenvolvimento de programas de computador sob encomenda", | ||
}, | ||
{ | ||
"code": "62.03-1-00", | ||
"text": """Desenvolvimento e licenciamento de programas | ||
de computador não-customizáveis""", | ||
}, | ||
{ | ||
"code": "62.09-1-00", | ||
"text": """Suporte técnico, manutenção e outros | ||
serviços em tecnologia da informação""", | ||
}, | ||
{ | ||
"code": "63.11-9-00", | ||
"text": """Tratamento de dados, provedores de serviços de | ||
aplicação e serviços de hospedagem na internet""", | ||
}, | ||
{ | ||
"code": "85.99-6-04", | ||
"text": "Treinamento em desenvolvimento profissional e gerencial", | ||
}, | ||
] | ||
with mock.patch( | ||
"odoo.addons.l10n_br_cnpj_search.models.cnpj_webservice.CNPJWebservice.validate", | ||
return_value=mocked_response, | ||
): | ||
self.crm_lead_1.write({"cnpj_cpf": "31.954.065/0001-08"}) | ||
action_wizard = self.crm_lead_1.action_open_cnpj_search_wizard() | ||
wizard_context = action_wizard.get("context") | ||
wizard = ( | ||
self.env["partner.search.wizard"] | ||
.with_context(**wizard_context) | ||
.create({}) | ||
) | ||
wizard.action_update_partner() | ||
self.assertEqual( | ||
self.crm_lead_1.legal_name, | ||
"Kilian Macedo Melcher 08777131460", | ||
) | ||
self.assertEqual(self.crm_lead_1.name, "Kilian Macedo Melcher 08777131460") | ||
self.assertEqual(self.crm_lead_1.street, "Rua Luiza Bezerra Motta") | ||
self.assertEqual(self.crm_lead_1.street2, "Bloco E;Apt 302") | ||
self.assertEqual(self.crm_lead_1.street_number, "950") | ||
self.assertEqual(self.crm_lead_1.zip, "58.410-410") | ||
self.assertEqual(self.crm_lead_1.district, "Catole") | ||
self.assertEqual(self.crm_lead_1.phone, "(83) 8665-0905") | ||
self.assertEqual(self.crm_lead_1.state_id.code, "PB") | ||
self.assertEqual(self.crm_lead_1.equity_capital, 3000.00) | ||
self.assertEqual(self.crm_lead_1.cnae_main_id.code, "4751-2/01") | ||
|
||
cnaes = [ | ||
"6201-5/01", | ||
"6203-1/00", | ||
"6209-1/00", | ||
"6311-9/00", | ||
"8599-6/04", | ||
] | ||
cnaes = sorted(cnaes) | ||
cnae_secondary_codes = [ | ||
cnae.code for cnae in self.crm_lead_1.cnae_secondary_ids | ||
] | ||
cnae_secondary_codes = sorted(cnae_secondary_codes) | ||
for i in range(0, len(cnae_secondary_codes)): | ||
self.assertEqual(cnaes[i], cnae_secondary_codes[i]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters