diff --git a/l10n_br_fiscal/models/document_event.py b/l10n_br_fiscal/models/document_event.py index d613ce041e9f..363b5f977b6f 100644 --- a/l10n_br_fiscal/models/document_event.py +++ b/l10n_br_fiscal/models/document_event.py @@ -235,7 +235,7 @@ def _save_event_2disk(self, arquivo, file_name): if not os.path.exists(save_dir): os.makedirs(save_dir) f = open(file_path, "w") - except IOError as e: + except OSError as e: raise UserError( _("Erro!"), _( diff --git a/l10n_br_fiscal/models/subsequent_document.py b/l10n_br_fiscal/models/subsequent_document.py index 58b7c6dd3515..9b93b03d351a 100644 --- a/l10n_br_fiscal/models/subsequent_document.py +++ b/l10n_br_fiscal/models/subsequent_document.py @@ -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 diff --git a/l10n_br_fiscal/models/subsequent_operation.py b/l10n_br_fiscal/models/subsequent_operation.py index c4864d6a1f6d..4e3835f9232e 100644 --- a/l10n_br_fiscal/models/subsequent_operation.py +++ b/l10n_br_fiscal/models/subsequent_operation.py @@ -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 diff --git a/l10n_br_fiscal/wizards/document_import_wizard_mixin.py b/l10n_br_fiscal/wizards/document_import_wizard_mixin.py index 6231fdcaac67..f6729a29cdc2 100644 --- a/l10n_br_fiscal/wizards/document_import_wizard_mixin.py +++ b/l10n_br_fiscal/wizards/document_import_wizard_mixin.py @@ -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): diff --git a/l10n_br_fiscal_dfe/tests/test_dfe.py b/l10n_br_fiscal_dfe/tests/test_dfe.py index 6c5e27351455..659886b38b10 100644 --- a/l10n_br_fiscal_dfe/tests/test_dfe.py +++ b/l10n_br_fiscal_dfe/tests/test_dfe.py @@ -20,7 +20,7 @@ response_rejeicao = """21.4.0589Rejeicao: Numero do NSU informado superior ao maior NSU da base de dados doAmbiente Nacional2022-04-04T11:54:49-03:00000000000000000000000000000000""" -class FakeRetorno(object): +class FakeRetorno: def __init__(self, text, status_code=200): self.text = text self.content = text.encode("utf-8") diff --git a/l10n_br_ie_search/tests/test_sefaz.py b/l10n_br_ie_search/tests/test_sefaz.py index 0f78e80486ef..4a348e3d1aec 100644 --- a/l10n_br_ie_search/tests/test_sefaz.py +++ b/l10n_br_ie_search/tests/test_sefaz.py @@ -12,7 +12,7 @@ from odoo.tools.misc import format_date -class FakeRetorno(object): +class FakeRetorno: __slots__ = "text", "ok" diff --git a/l10n_br_ie_search/tests/test_sintegra.py b/l10n_br_ie_search/tests/test_sintegra.py index 1d19c5f6f003..8fa5d867b477 100644 --- a/l10n_br_ie_search/tests/test_sintegra.py +++ b/l10n_br_ie_search/tests/test_sintegra.py @@ -10,7 +10,7 @@ _logger = logging.getLogger(__name__) -class FakeRetorno(object): +class FakeRetorno: __slots__ = "text", "status_code" def json(self): diff --git a/l10n_br_nfe/tests/test_nfce.py b/l10n_br_nfe/tests/test_nfce.py index f906ce753784..09107069f056 100644 --- a/l10n_br_nfe/tests/test_nfce.py +++ b/l10n_br_nfe/tests/test_nfce.py @@ -38,7 +38,7 @@ response_contingency = """24.0.0108Rejeição: Duplicidade de NF-e332023-08-08T10:30:00-03:001234567890123451""" -class FakeRetorno(object): +class FakeRetorno: def __init__(self, text): self.text = text self.content = text.encode("utf-8") diff --git a/l10n_br_nfe/tests/test_nfe_mde.py b/l10n_br_nfe/tests/test_nfe_mde.py index 822873c651a5..245a7e7c63e5 100644 --- a/l10n_br_nfe/tests/test_nfe_mde.py +++ b/l10n_br_nfe/tests/test_nfe_mde.py @@ -27,7 +27,7 @@ response_operacao_nao_realizada = """2SVRS2023052515551352SVRS202305251555135Teste Operação não Realizada.31201010588201000105550010038421171838422178210240Operacao nao Realizada registrada1815830540001292023-07-10T10:00:00-03:00""" -class FakeRetorno(object): +class FakeRetorno: def __init__(self, text, status_code=200): self.text = text self.content = text.encode("utf-8") diff --git a/l10n_br_nfe/tests/test_nfe_webservices.py b/l10n_br_nfe/tests/test_nfe_webservices.py index 975f333eaa76..0c4cff6675d9 100644 --- a/l10n_br_nfe/tests/test_nfe_webservices.py +++ b/l10n_br_nfe/tests/test_nfe_webservices.py @@ -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")