Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][REF] Atualização da bibliotecas do Pre-commit: Outras alterações diversas #2753

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion l10n_br_account_due_list/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AccountInvoice(models.Model):
def _compute_financial(self):
for move in self:
lines = move.line_ids.filtered(
lambda l: l.account_id.internal_type in ("receivable", "payable")
lambda line: line.account_id.internal_type in ("receivable", "payable")
)
move.financial_move_line_ids = lines.sorted()

Expand Down
1 change: 0 additions & 1 deletion l10n_br_base/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def check_ie(env, inscr_est, state, country):
# Se no caso da empresa ser 'isenta' do IE o campo
# deve estar vazio ou pode ter algum valor como abaixo
if inscr_est not in ("isento", "isenta", "ISENTO", "ISENTA"):

if not ie.validar(state.code.lower(), inscr_est):
raise ValidationError(
_("Estadual Inscription {} Invalid for State {}!").format(
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_fiscal/models/document_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
if not os.path.exists(save_dir):
os.makedirs(save_dir)
f = open(file_path, "w")
except IOError as e:
except OSError as e:

Check warning on line 238 in l10n_br_fiscal/models/document_event.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_fiscal/models/document_event.py#L238

Added line #L238 was not covered by tests
raise UserError(
_("Erro!"),
_(
Expand Down
1 change: 0 additions & 1 deletion l10n_br_fiscal/models/subsequent_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# License AGPL-3 or later (http://www.gnu.org/licenses/agpl)
#

from __future__ import division, print_function, unicode_literals

from odoo import api, fields, models

Expand Down
2 changes: 0 additions & 2 deletions l10n_br_fiscal/models/subsequent_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html


from __future__ import division, print_function, unicode_literals

from odoo import fields, models

from ..constants.fiscal import SITUACAO_EDOC
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_fiscal/wizards/document_import_wizard_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from odoo import fields, models

from odoo.addons.l10n_br_fiscal.constants.fiscal import FISCAL_IN_OUT_ALL
from ..constants.fiscal import FISCAL_IN_OUT_ALL


class DocumentImportWizardMixin(models.TransientModel):
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_fiscal_dfe/tests/test_dfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
response_rejeicao = """<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><nfeDistDFeInteresseResponse xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe"><nfeDistDFeInteresseResult><retDistDFeInt xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.01"><tpAmb>2</tpAmb><verAplic>1.4.0</verAplic><cStat>589</cStat><xMotivo>Rejeicao: Numero do NSU informado superior ao maior NSU da base de dados doAmbiente Nacional</xMotivo><dhResp>2022-04-04T11:54:49-03:00</dhResp><ultNSU>000000000000000</ultNSU><maxNSU>000000000000000</maxNSU></retDistDFeInt></nfeDistDFeInteresseResult></nfeDistDFeInteresseResponse></soap:Body></soap:Envelope>"""


class FakeRetorno(object):
class FakeRetorno:
def __init__(self, text, status_code=200):
self.text = text
self.content = text.encode("utf-8")
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_ie_search/tests/test_sefaz.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from odoo.tools.misc import format_date


class FakeRetorno(object):
class FakeRetorno:
__slots__ = "text", "ok"


Expand Down
2 changes: 1 addition & 1 deletion l10n_br_ie_search/tests/test_sintegra.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
_logger = logging.getLogger(__name__)


class FakeRetorno(object):
class FakeRetorno:
__slots__ = "text", "status_code"

def json(self):
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_nfe/tests/test_nfce.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
response_contingency = """<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><nfeResultMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeAutorizacao4"><retEnviNFe xmlns="http://www.portalfiscal.inf.br/nfe" versao="4.00"><tpAmb>2</tpAmb><verAplic>4.0.0</verAplic><cStat>108</cStat><xMotivo>Rejeição: Duplicidade de NF-e</xMotivo><cUF>33</cUF><dhRecbto>2023-08-08T10:30:00-03:00</dhRecbto><infRec><nRec>123456789012345</nRec><tMed>1</tMed></infRec></retEnviNFe></nfeResultMsg></soap:Body></soap:Envelope>"""


class FakeRetorno(object):
class FakeRetorno:
def __init__(self, text):
self.text = text
self.content = text.encode("utf-8")
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_nfe/tests/test_nfe_import_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class NFeImportWizardTest(SavepointCase):
def setUp(self):
super(NFeImportWizardTest, self).setUp()
super().setUp()

def test_xml_path(filename):
return os.path.join(
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_nfe/tests/test_nfe_mde.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
response_operacao_nao_realizada = """<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><nfeResultMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeRecepcaoEvento4"><retEnvEvento xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.00"><idLote /><tpAmb>2</tpAmb><verAplic>SVRS202305251555</verAplic><cStat>135</cStat><retEvento versao="1.00"><infEvento><tpAmb>2</tpAmb><verAplic>SVRS202305251555</verAplic><cStat>135</cStat><xMotivo>Teste Operação não Realizada.</xMotivo><chNFe>31201010588201000105550010038421171838422178</chNFe><tpEvento>210240</tpEvento><xEvento>Operacao nao Realizada registrada</xEvento><nSeqEvento>1</nSeqEvento><CNPJDest>81583054000129</CNPJDest><dhRegEvento>2023-07-10T10:00:00-03:00</dhRegEvento></infEvento></retEvento></retEnvEvento></nfeResultMsg></soap:Body></soap:Envelope>"""


class FakeRetorno(object):
class FakeRetorno:
def __init__(self, text, status_code=200):
self.text = text
self.content = text.encode("utf-8")
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_nfe/tests/test_nfe_webservices.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def is_libreoffice_command_available():
return False


class FakeRetorno(object):
class FakeRetorno:
def __init__(self, text):
self.text = text
self.content = text.encode("utf-8")
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_pos_cfe/models/pos_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PosOrder(models.Model):

@api.model
def _order_fields(self, ui_order):
order_fields = super(PosOrder, self)._order_fields(ui_order)
order_fields = super()._order_fields(ui_order)

document_key = ui_order.get("document_key")
document_type = ui_order.get("document_type")
Expand Down
Loading