[pre-commit] pre-commit fix issues, only ofx module

This commit is contained in:
RPSJR
2021-08-08 11:45:40 -03:00
parent cff642130d
commit ef981c8d65
5 changed files with 9 additions and 9 deletions

View File

@@ -1,2 +1 @@
from . import models from . import models, wizard
from . import wizard

View File

@@ -11,8 +11,8 @@
"Le Filament," "Le Filament,"
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/bank-statement-import", "website": "https://github.com/OCA/bank-statement-import",
"depends": ["account_bank_statement_import",], "depends": ["account_bank_statement_import"],
"data": ["views/view_account_bank_statement_import.xml",], "data": ["views/view_account_bank_statement_import.xml"],
"external_dependencies": {"python": ["ofxparse"],}, "external_dependencies": {"python": ["ofxparse"]},
"installable": True, "installable": True,
} }

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -62,7 +62,7 @@ class TestOfxFile(TransactionCase):
) )
ofx_file_wrong = base64.b64encode(open(ofx_file_path, "rb").read()) ofx_file_wrong = base64.b64encode(open(ofx_file_path, "rb").read())
attach = self.ia_model.create( attach = self.ia_model.create(
{"name": "test_ofx_wrong.ofx", "datas": ofx_file_wrong,} {"name": "test_ofx_wrong.ofx", "datas": ofx_file_wrong}
) )
bank_statement = self.absi_model.create( bank_statement = self.absi_model.create(
dict(attachment_ids=[(6, 0, [attach.id])]) dict(attachment_ids=[(6, 0, [attach.id])])
@@ -74,7 +74,7 @@ class TestOfxFile(TransactionCase):
"account_bank_statement_import_ofx", "tests/test_ofx_file/", "test_ofx.ofx" "account_bank_statement_import_ofx", "tests/test_ofx_file/", "test_ofx.ofx"
) )
ofx_file = base64.b64encode(open(ofx_file_path, "rb").read()) ofx_file = base64.b64encode(open(ofx_file_path, "rb").read())
attach = self.ia_model.create({"name": "test_ofx.ofx", "datas": ofx_file,}) attach = self.ia_model.create({"name": "test_ofx.ofx", "datas": ofx_file})
bank_statement = self.absi_model.create( bank_statement = self.absi_model.create(
dict(attachment_ids=[(6, 0, [attach.id])]) dict(attachment_ids=[(6, 0, [attach.id])])
) )
@@ -96,7 +96,7 @@ class TestOfxFile(TransactionCase):
"test_ofx_iban.ofx", "test_ofx_iban.ofx",
) )
ofx_file = base64.b64encode(open(ofx_file_path, "rb").read()) ofx_file = base64.b64encode(open(ofx_file_path, "rb").read())
attach = self.ia_model.create({"name": "test_ofx.ofx", "datas": ofx_file,}) attach = self.ia_model.create({"name": "test_ofx.ofx", "datas": ofx_file})
bank_st = self.absi_model.create(dict(attachment_ids=[(6, 0, [attach.id])])) bank_st = self.absi_model.create(dict(attachment_ids=[(6, 0, [attach.id])]))
journal_iban_ofx = self.j_model.search( journal_iban_ofx = self.j_model.search(
[("name", "=", "FR7630001007941234567890185")] [("name", "=", "FR7630001007941234567890185")]

View File

@@ -87,7 +87,8 @@ class AccountBankStatementImport(models.TransientModel):
"The following problem occurred during import. " "The following problem occurred during import. "
"The file might not be valid.\n\n %s" "The file might not be valid.\n\n %s"
) )
% e.message # % e.message # flake8 B306 `BaseException.message`
% e.args[0]
) )
balance = float(ofx.account.statement.balance) balance = float(ofx.account.statement.balance)