Skip to content

Commit

Permalink
Merge pull request #1950 from akretion/12.0-pre-commit-after-update
Browse files Browse the repository at this point in the history
[12.0] pre-commit after pre-commit version upgrade
  • Loading branch information
rvalyi authored Jun 2, 2022
2 parents 0c9eeaa + 33856e7 commit 5009aa7
Show file tree
Hide file tree
Showing 41 changed files with 162 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def setUpClass(cls):
)

def test_nfe_generate_tag_pag(self):
""" Test NFe generate TAG PAG."""
"""Test NFe generate TAG PAG."""
# Dados criados no teste
for detPag in self.invoice.nfe40_detPag:
self.assertEqual(detPag.nfe40_indPag, "1", "Error in nfe40_indPag field.")
Expand All @@ -135,7 +135,7 @@ def test_nfe_generate_tag_pag(self):
self.assertEqual(detPag.nfe40_vPag, 1000.0, "Error in nfe40_vPag field.")

def test_nfe_generate_tag_cobr_and_dup(self):
""" Test NFe generate TAG COBR e DUP."""
"""Test NFe generate TAG COBR e DUP."""
# Dados criados no teste
self.assertEqual(self.invoice.nfe40_vOrig, 472.5)
self.assertEqual(self.invoice.nfe40_vDesc, 0.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def test_banco_ailos_cnab_240(self):
)

def test_bank_cnab_not_implement_brcobranca(self):
""" Test Bank CNAB not implemented in BRCobranca."""
"""Test Bank CNAB not implemented in BRCobranca."""
invoice = self.env.ref(
"l10n_br_account_payment_order.demo_invoice_payment_order_itau_cnab240"
)
Expand All @@ -228,7 +228,7 @@ def test_bank_cnab_not_implement_brcobranca(self):
invoice.view_boleto_pdf()

def test_payment_order_invoice_cancel_process(self):
""" Test Payment Order and Invoice Cancel process."""
"""Test Payment Order and Invoice Cancel process."""

payment_order = self.env["account.payment.order"].search(
[("payment_mode_id", "=", self.invoice_cef.payment_mode_id.id)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class L10nBrCNABBoletoFields(models.Model):
)

boleto_discount_perc = fields.Float(
string=u"Percentual de Desconto até a Data de Vencimento",
string="Percentual de Desconto até a Data de Vencimento",
digits=dp.get_precision("Account"),
track_visibility="always",
)
Expand Down
6 changes: 3 additions & 3 deletions l10n_br_account_payment_order/tests/test_base_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ def setUpClass(cls):
)

def _payment_order_all_workflow(self, payment_order_id):
""" Run all Payment Order Workflow"""
"""Run all Payment Order Workflow"""
payment_order_id.draft2open()
payment_order_id.open2generated()
payment_order_id.generated2uploaded()
payment_order_id.action_done()

def _invoice_payment_order_all_workflow(self, invoice):
""" Search for the payment order related to the invoice"""
"""Search for the payment order related to the invoice"""
payment_order_id = self.env["account.payment.order"].search(
[
("state", "=", "draft"),
Expand All @@ -39,7 +39,7 @@ def _invoice_payment_order_all_workflow(self, invoice):
return payment_order_id

def _prepare_change_view(self, financial_move_line_ids):
""" Prepare context of the change view"""
"""Prepare context of the change view"""
ctx = dict(
active_ids=financial_move_line_ids.ids, active_model="account.move.line"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ def _invoice_confirm_flow(self):
self.assertEqual(self.invoice_manual_test.state, "open")

def test_invoice_button(self):
""" Test Invoice Button to Add to a payment order"""
"""Test Invoice Button to Add to a payment order"""
self._invoice_confirm_flow()
self.invoice_manual_test.create_account_payment_line()
self._invoice_payment_order_all_workflow(self.invoice_manual_test)

def test_payment_order_wizard(self):
""" Test Payment Order Wizard"""
"""Test Payment Order Wizard"""
self._invoice_confirm_flow()
payment_mode_id = self.invoice_manual_test.payment_mode_id
self.import_with_po_wizard(payment_mode_id)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def setUpClass(cls):
)

def test_cancel_invoice_no_payment_mode_pay(self):
""" Test Pay Invoice without payment mode in cash"""
"""Test Pay Invoice without payment mode in cash"""
self.invoice_customer_without_paymeny_mode.action_invoice_open()

# I check that the invoice state is "Open"
Expand All @@ -37,7 +37,7 @@ def test_cancel_invoice_no_payment_mode_pay(self):
)

def test_cancel_invoice_no_payment_mode_cancel(self):
""" Test Cancel Invoice Without Payment Mode """
"""Test Cancel Invoice Without Payment Mode"""
self.invoice_customer_without_paymeny_mode.action_invoice_cancel()

# I check that the invoice state is "Cancel"
Expand Down
4 changes: 2 additions & 2 deletions l10n_br_account_payment_order/tests/test_payment_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def setUpClass(cls):
)

def test_payment_mode_without_payment_order(self):
""" Test Invoice when Payment Mode not generate Payment Order. """
"""Test Invoice when Payment Mode not generate Payment Order."""
self.invoice_cheque._onchange_payment_mode_id()
# I validate invoice by creating on
self.invoice_cheque.action_invoice_open()
Expand All @@ -29,7 +29,7 @@ def test_payment_mode_without_payment_order(self):
self.assertEqual(len(payment_order), 0)

def test_bra_number_constrains(self):
""" Test bra_number constrains. """
"""Test bra_number constrains."""
self.banco_bradesco = self.env["res.bank"].search([("code_bc", "=", "033")])
with self.assertRaises(ValidationError):
self.env["res.partner.bank"].create(
Expand Down
18 changes: 9 additions & 9 deletions l10n_br_account_payment_order/tests/test_payment_order_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def setUpClass(cls):
assert cls.financial_move_line_1, "Move 1 not created for open invoice"

def test_change_date_maturity_multiple(self):
""" Test Creation of a Payment Order an change MULTIPLE due date """
"""Test Creation of a Payment Order an change MULTIPLE due date"""
self._invoice_payment_order_all_workflow(self.invoice_auto)
date_maturity = self.financial_move_line_ids.mapped("date_maturity")
new_date = date.today() + timedelta(days=120)
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_change_date_maturity_multiple(self):
), "Payment Order with wrong mov_instruction_code_id"

def test_change_date_maturity_one(self):
""" Test Creation of a Payment Order an change ONE due date """
"""Test Creation of a Payment Order an change ONE due date"""
self._invoice_payment_order_all_workflow(self.invoice_auto)
date_maturity = self.financial_move_line_0.mapped("date_maturity")
new_date = date.today() + timedelta(days=120)
Expand Down Expand Up @@ -124,7 +124,7 @@ def test_change_date_maturity_one(self):
# )

def test_change_not_payment(self):
""" Test Creation of a Payment Order an change not_payment """
"""Test Creation of a Payment Order an change not_payment"""
self._invoice_payment_order_all_workflow(self.invoice_auto)
financial_move_line_ids = self.invoice_auto.financial_move_line_ids[0]
with Form(
Expand Down Expand Up @@ -152,7 +152,7 @@ def test_change_not_payment(self):
), "Payment Order with wrong mov_instruction_code_id"

def test_change_protest_tittle(self):
""" Test Creation of a Payment Order an change protest_tittle """
"""Test Creation of a Payment Order an change protest_tittle"""
self._invoice_payment_order_all_workflow(self.invoice_auto)
financial_move_line_ids = self.invoice_auto.financial_move_line_ids[0]
with Form(
Expand Down Expand Up @@ -180,7 +180,7 @@ def test_change_protest_tittle(self):
), "Payment Order with wrong mov_instruction_code_id"

def test_change_suspend_protest_keep_wallet(self):
""" Test Creation of a Payment Order an change suspend_protest_keep_wallet """
"""Test Creation of a Payment Order an change suspend_protest_keep_wallet"""
self._invoice_payment_order_all_workflow(self.invoice_auto)
financial_move_line_ids = self.invoice_auto.financial_move_line_ids[0]
with Form(
Expand Down Expand Up @@ -208,7 +208,7 @@ def test_change_suspend_protest_keep_wallet(self):
), "Payment Order with wrong mov_instruction_code_id"

def test_change_suspend_grant_rebate(self):
""" Test Creation of a Payment Order an change grant_rebate """
"""Test Creation of a Payment Order an change grant_rebate"""
self._invoice_payment_order_all_workflow(self.invoice_auto)
financial_move_line_ids = self.invoice_auto.financial_move_line_ids[0]
with Form(
Expand Down Expand Up @@ -237,7 +237,7 @@ def test_change_suspend_grant_rebate(self):
), "Payment Order with wrong mov_instruction_code_id"

def test_change_suspend_grant_discount(self):
""" Test Creation of a Payment Order an change grant_discount """
"""Test Creation of a Payment Order an change grant_discount"""
self._invoice_payment_order_all_workflow(self.invoice_auto)
financial_move_line_ids = self.invoice_auto.financial_move_line_ids[0]
with Form(
Expand Down Expand Up @@ -266,7 +266,7 @@ def test_change_suspend_grant_discount(self):
), "Payment Order with wrong mov_instruction_code_id"

def test_change_suspend_cancel_rebate(self):
""" Test Creation of a Payment Order an change cancel_rebate """
"""Test Creation of a Payment Order an change cancel_rebate"""
self._invoice_payment_order_all_workflow(self.invoice_auto)
financial_move_line_ids = self.invoice_auto.financial_move_line_ids[0]
with Form(
Expand Down Expand Up @@ -294,7 +294,7 @@ def test_change_suspend_cancel_rebate(self):
), "Payment Order with wrong mov_instruction_code_id"

def test_change_suspend_cancel_discount(self):
""" Test Creation of a Payment Order an change cancel_discount """
"""Test Creation of a Payment Order an change cancel_discount"""
self._invoice_payment_order_all_workflow(self.invoice_auto)
financial_move_line_ids = self.invoice_auto.financial_move_line_ids[0]
with Form(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def setUpClass(cls):
)

def test_create_payment_order(self):
""" Test Create Payment Order """
"""Test Create Payment Order"""

# I check that Initially customer invoice is in the "Draft" state
self.assertEqual(self.invoice_cef.state, "draft")
Expand Down Expand Up @@ -214,7 +214,7 @@ def test_payment_outside_cnab_payment_order_open(self):
register_payments.create_payments()

def test_cancel_invoice_payment_order_draft(self):
""" Test Cancel Invoice when Payment Order Draft."""
"""Test Cancel Invoice when Payment Order Draft."""

# I validate invoice by creating on
self.invoice_unicred.action_invoice_open()
Expand Down
16 changes: 8 additions & 8 deletions l10n_br_base/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,47 +31,47 @@ def _get_company_address_fields(self, partner):
return partner_fields

def _inverse_legal_name(self):
""" Write the l10n_br specific functional fields. """
"""Write the l10n_br specific functional fields."""
for company in self:
company.partner_id.legal_name = company.legal_name

def _inverse_district(self):
""" Write the l10n_br specific functional fields. """
"""Write the l10n_br specific functional fields."""
for company in self:
company.partner_id.district = company.district

def _inverse_cnpj_cpf(self):
""" Write the l10n_br specific functional fields. """
"""Write the l10n_br specific functional fields."""
for company in self:
company.partner_id.cnpj_cpf = company.cnpj_cpf

def _inverse_state(self):
""" Write the l10n_br specific functional fields. """
"""Write the l10n_br specific functional fields."""
for company in self:
company.partner_id.write(
{"state_id": company.state_id.id, "inscr_est": company.inscr_est}
)

def _inverse_state_tax_number_ids(self):
""" Write the l10n_br specific functional fields. """
"""Write the l10n_br specific functional fields."""
for company in self:
state_tax_number_ids = self.env["state.tax.numbers"]
for ies in company.state_tax_number_ids:
state_tax_number_ids |= ies
company.partner_id.state_tax_number_ids = state_tax_number_ids

def _inverse_inscr_mun(self):
""" Write the l10n_br specific functional fields. """
"""Write the l10n_br specific functional fields."""
for company in self:
company.partner_id.inscr_mun = company.inscr_mun

def _inverse_city_id(self):
""" Write the l10n_br specific functional fields. """
"""Write the l10n_br specific functional fields."""
for company in self:
company.partner_id.city_id = company.city_id

def _inverse_suframa(self):
""" Write the l10n_br specific functional fields. """
"""Write the l10n_br specific functional fields."""
for company in self:
company.partner_id.suframa = company.suframa

Expand Down
16 changes: 8 additions & 8 deletions l10n_br_base/tests/test_amount_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ def test_02_amount_to_text(self):
def test_03_amount_to_text(self):
self.assertEqual(
self.n2w.to_currency(77777.0),
u"setenta e sete mil, setecentos e setenta" u" e sete reais",
"setenta e sete mil, setecentos e setenta" " e sete reais",
)

def test_04_amount_to_text(self):
self.assertEqual(
self.n2w.to_currency(1856333.0),
u"um milhão, oitocentos e cinquenta e seis mil,"
u" trezentos e trinta e três reais",
"um milhão, oitocentos e cinquenta e seis mil,"
" trezentos e trinta e três reais",
)

def test_05_amount_to_text(self):
self.assertEqual(
self.n2w.to_currency(9999999.0),
u"nove milhões, novecentos e noventa e nove mil,"
u" novecentos e noventa e nove reais",
"nove milhões, novecentos e noventa e nove mil,"
" novecentos e noventa e nove reais",
)

def test_06_amount_to_text(self):
self.assertEqual(
self.n2w.to_currency(9999999999.0),
u"nove bilhões, novecentos e noventa e nove milhões,"
u" novecentos e noventa e nove mil, novecentos e"
u" noventa e nove reais",
"nove bilhões, novecentos e noventa e nove milhões,"
" novecentos e noventa e nove mil, novecentos e"
" noventa e nove reais",
)
2 changes: 1 addition & 1 deletion l10n_br_crm/models/crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


class Lead(models.Model):
""" CRM Lead Case """
"""CRM Lead Case"""

_inherit = "crm.lead"

Expand Down
4 changes: 2 additions & 2 deletions l10n_br_crm/tests/test_crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_conversion(self):
)

def test_create_partner(self):
""" Create a Partner and check the if the fields were filled """
"""Create a Partner and check the if the fields were filled"""
self.partner_id = self.crm_lead_company._create_lead_partner()

self.obj_partner = self.env["res.partner"].browse(self.partner_id.id)
Expand Down Expand Up @@ -163,7 +163,7 @@ def test_conversion_contact(self):
)

def test_create_contact(self):
""" Create a Contact and check the if the fields were filled """
"""Create a Contact and check the if the fields were filled"""
self.partner_id = self.crm_lead_contact._create_lead_partner()
self.obj_partner = self.env["res.partner"].browse(self.partner_id.id)

Expand Down
12 changes: 6 additions & 6 deletions l10n_br_fiscal/models/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ def format_amount(self, env, amount, currency):

formatted_amount = (
lang.format(fmt, currency.round(amount), grouping=True, monetary=True)
.replace(r" ", u"\N{NO-BREAK SPACE}")
.replace(r"-", u"-\N{ZERO WIDTH NO-BREAK SPACE}")
.replace(r" ", "\N{NO-BREAK SPACE}")
.replace(r"-", "-\N{ZERO WIDTH NO-BREAK SPACE}")
)

pre = post = u""
pre = post = ""
if currency.position == "before":
pre = u"{symbol}\N{NO-BREAK SPACE}".format(symbol=currency.symbol or "")
pre = "{symbol}\N{NO-BREAK SPACE}".format(symbol=currency.symbol or "")
else:
post = u"\N{NO-BREAK SPACE}{symbol}".format(symbol=currency.symbol or "")
post = "\N{NO-BREAK SPACE}{symbol}".format(symbol=currency.symbol or "")

return u"{pre}{0}{post}".format(formatted_amount, pre=pre, post=post)
return "{pre}{0}{post}".format(formatted_amount, pre=pre, post=post)

def compute_message(self, vals, manual_comment=None):

Expand Down
6 changes: 3 additions & 3 deletions l10n_br_fiscal/models/partner_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PartnerProfile(models.Model):

is_company = fields.Boolean(string="Is Company?")

default = fields.Boolean(string=u"Default Profile", default=True)
default = fields.Boolean(string="Default Profile", default=True)

ind_ie_dest = fields.Selection(
selection=NFE_IND_IE_DEST,
Expand Down Expand Up @@ -87,8 +87,8 @@ def _check_default(self):
):
raise ValidationError(
_(
u"Mantenha apenas um tipo fiscal padrão"
u" para Pessoa Física ou para Pessoa Jurídica!"
"Mantenha apenas um tipo fiscal padrão"
" para Pessoa Física ou para Pessoa Jurídica!"
)
)
return True
Expand Down
Loading

0 comments on commit 5009aa7

Please sign in to comment.