Skip to content

Commit

Permalink
[REF] l10n_br_cnpj_search: CNPJ->vat
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
rvalyi committed Sep 30, 2024
1 parent 895c3ed commit 0d9f2ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion l10n_br_cnpj_search/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Brazilian Localization CNPJ Search",
"summary": """
Integração com os Webservices da ReceitaWS e SerPro""",
"version": "16.0.1.4.0",
"version": "16.0.1.4.1",
"license": "AGPL-3",
"author": "KMEE,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-brazil",
Expand Down
4 changes: 2 additions & 2 deletions l10n_br_cnpj_search/tests/test_receitaws.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_receita_ws_success(self):
)
def test_receita_ws_fail(self):
invalido = self.model.create({"name": "invalido", "cnpj_cpf": "00000000000000"})
invalido._onchange_cnpj_cpf()
invalido._onchange_vat()

with self.assertRaises(ValidationError):
action_wizard = invalido.action_open_cnpj_search_wizard()
Expand All @@ -76,7 +76,7 @@ def test_receita_ws_fail(self):
)
def test_receita_ws_multiple_phones(self):
isla = self.model.create({"name": "Isla", "cnpj_cpf": "92.666.056/0001-06"})
isla._onchange_cnpj_cpf()
isla._onchange_vat()

action_wizard = isla.action_open_cnpj_search_wizard()
wizard_context = action_wizard.get("context")
Expand Down
16 changes: 6 additions & 10 deletions l10n_br_cnpj_search/tests/test_serpro.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_serpro_basica(self):
dummy_basica = self.model.create(
{"name": "Dummy Basica", "cnpj_cpf": "34.238.864/0001-68"}
)
dummy_basica._onchange_cnpj_cpf()
dummy_basica._onchange_vat()

action_wizard = dummy_basica.action_open_cnpj_search_wizard()
wizard_context = action_wizard.get("context")
Expand Down Expand Up @@ -71,7 +71,7 @@ def test_serpro_not_found(self):
invalid = self.model.create(
{"name": "invalid", "cnpj_cpf": "44.356.113/0001-08"}
)
invalid._onchange_cnpj_cpf()
invalid._onchange_vat()

with self.assertRaises(ValidationError):
action_wizard = invalid.action_open_cnpj_search_wizard()
Expand Down Expand Up @@ -123,16 +123,14 @@ def assert_socios(self, partner, expected_cnpjs):
ignore_localhost=True,
)
def test_serpro_empresa(self):
self.model.search([("cnpj_cpf", "=", "34.238.864/0001-68")]).write(
{"active": False}
)
self.model.search([("vat", "=", "34.238.864/0001-68")]).write({"active": False})
self.set_param("serpro_schema", "empresa")

dummy_empresa = self.model.create(
{"name": "Dummy Empresa", "cnpj_cpf": "34.238.864/0001-68"}
)

dummy_empresa._onchange_cnpj_cpf()
dummy_empresa._onchange_vat()
action_wizard = dummy_empresa.action_open_cnpj_search_wizard()
wizard_context = action_wizard.get("context")
wizard = (
Expand All @@ -156,16 +154,14 @@ def test_serpro_empresa(self):
ignore_localhost=True,
)
def test_serpro_qsa(self):
self.model.search([("cnpj_cpf", "=", "34.238.864/0001-68")]).write(
{"active": False}
)
self.model.search([("vat", "=", "34.238.864/0001-68")]).write({"active": False})
self.set_param("serpro_schema", "qsa")

dummy_qsa = self.model.create(
{"name": "Dummy QSA", "cnpj_cpf": "34.238.864/0001-68"}
)

dummy_qsa._onchange_cnpj_cpf()
dummy_qsa._onchange_vat()
action_wizard = dummy_qsa.action_open_cnpj_search_wizard()
wizard_context = action_wizard.get("context")
wizard = (
Expand Down

0 comments on commit 0d9f2ea

Please sign in to comment.