Skip to content

Commit 9861a1c

Browse files
committed
[FIX] l10n_br_cnpj_search: pre-commit
1 parent ae3dc3c commit 9861a1c

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

l10n_br_cnpj_search/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Brazilian Localization CNPJ Search
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:9f660a5cf5d9e7c903559a6bf11c459e96b9a6f6e78a9b48941c54d030774060
10+
!! source digest: sha256:b75c0c19af2d63fd70d67fbb130cbbf4f9a4393f3f048abb85d387672d1eac92
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png

l10n_br_cnpj_search/models/l10n_br_base_party_mixin.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ class PartyMixin(models.AbstractModel):
1414
def search_cnpj(self):
1515
"""Search CNPJ by the chosen API"""
1616
if not self.cnpj_cpf:
17-
raise UserError("Por favor insira o CNPJ")
17+
raise UserError(_("Please enter your CNPJ"))
1818

1919
if self.cnpj_validation_disabled():
2020
raise UserError(
21-
21+
_(
2222
"It is necessary to activate the option to validate de CNPJ to use this "
2323
+ "functionality."
24+
)
2425
)
2526

2627
cnpj_cpf = punctuation_rm(self.cnpj_cpf)
@@ -36,15 +37,17 @@ def search_cnpj(self):
3637

3738
def action_open_cnpj_search_wizard(self):
3839
if not self.cnpj_cpf:
39-
raise UserError("Please enter your CNPJ")
40+
raise UserError(_("Please enter your CNPJ"))
4041
# Forces the system to enter a name so the user doesn't have to type
4142
if not self.name:
4243
self.name = "/"
4344

4445
if self.cnpj_validation_disabled():
4546
raise UserError(
46-
"It is necessary to activate the option to validate de CNPJ to use this "
47-
+ "functionality."
47+
_(
48+
"It is necessary to activate the option to validate de CNPJ to use this "
49+
+ "functionality."
50+
)
4851
)
4952
return {
5053
"name": "Search Data by CNPJ",

l10n_br_cnpj_search/static/description/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
34
<head>
@@ -366,7 +367,7 @@ <h1 class="title">Brazilian Localization CNPJ Search</h1>
366367
!! This file is generated by oca-gen-addon-readme !!
367368
!! changes will be overwritten. !!
368369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369-
!! source digest: sha256:9f660a5cf5d9e7c903559a6bf11c459e96b9a6f6e78a9b48941c54d030774060
370+
!! source digest: sha256:b75c0c19af2d63fd70d67fbb130cbbf4f9a4393f3f048abb85d387672d1eac92
370371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371372
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-brazil/tree/14.0/l10n_br_cnpj_search"><img alt="OCA/l10n-brazil" src="https://img.shields.io/badge/github-OCA%2Fl10n--brazil-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_cnpj_search"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-brazil&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372373
<p>Módulo que adiciona um botão para preencher automaticamente os campos de um partner a partir do seu CNPJ.

l10n_br_cnpj_search/tests/test_partner_cnpj_search_wizard.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from odoo.tests.common import TransactionCase
22

3+
34
class TestPartnerCnpjSearchWizard(TransactionCase):
45
def setUp(self):
56
super(TestPartnerCnpjSearchWizard, self).setUp()
@@ -18,11 +19,11 @@ def test_open_partner_cnpj_search_wizard(self):
1819

1920
self.assertEqual(
2021
wizard.legal_name,
21-
"Nu Financeira S.A. - Sociedade De Credito, Financiamento E Investimento"
22+
"Nu Financeira S.A. - Sociedade De Credito, Financiamento E Investimento",
2223
)
2324
self.assertEqual(
2425
wizard.name,
25-
"Nu Financeira S.A. - Sociedade De Credito, Financiamento E Investimento"
26+
"Nu Financeira S.A. - Sociedade De Credito, Financiamento E Investimento",
2627
)
2728
self.assertEqual(wizard.street_name, "Rua Capote Valente")
2829
self.assertEqual(wizard.street2, "Andar 12 Ao 15")
@@ -41,7 +42,6 @@ def test_open_partner_cnpj_search_wizard(self):
4142
wizard.district = ""
4243
wizard.email = "recursoshumanos@macris.com.br"
4344

44-
4545
wizard.action_update_partner()
4646
self.assertEqual(partner.legal_name, original_legal_name)
4747
self.assertEqual(partner.street_name, "ROD SC 410")

l10n_br_cnpj_search/tests/test_receitaws.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def setUp(self):
1616

1717
self.set_param("cnpj_provider", "receitaws")
1818

19-
2019
def test_receita_ws_fail(self):
2120
invalido = self.model.create({"name": "invalido", "cnpj_cpf": "00000000000000"})
2221
invalido._onchange_cnpj_cpf()

l10n_br_cnpj_search/wizard/partner_cnpj_search_wizard.py

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def action_update_partner(self):
109109

110110
partner = partner_model.browse(partner_id)
111111

112-
113112
values_to_update = {
114113
"legal_name": self.legal_name,
115114
"name": self.name,

0 commit comments

Comments
 (0)