mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[IMP] account_bank_statement_import_qif: pre-commit stuff
This commit is contained in:
@@ -31,7 +31,9 @@ class TestQifFile(TransactionCase):
|
||||
|
||||
def test_qif_file_import(self):
|
||||
qif_file_path = get_module_resource(
|
||||
"account_bank_statement_import_qif", "tests", "test_qif.qif",
|
||||
"account_bank_statement_import_qif",
|
||||
"tests",
|
||||
"test_qif.qif",
|
||||
)
|
||||
qif_file = base64.b64encode(open(qif_file_path, "rb").read())
|
||||
wizard = self.statement_import_model.with_context(
|
||||
@@ -39,10 +41,12 @@ class TestQifFile(TransactionCase):
|
||||
).create({"attachment_ids": [(0, 0, {"name": "test file", "datas": qif_file})]})
|
||||
wizard.import_file()
|
||||
statement = self.statement_line_model.search(
|
||||
[("name", "=", "YOUR LOCAL SUPERMARKET")], limit=1,
|
||||
[("name", "=", "YOUR LOCAL SUPERMARKET")],
|
||||
limit=1,
|
||||
)[0].statement_id
|
||||
self.assertAlmostEqual(statement.balance_end_real, -1896.09, 2)
|
||||
line = self.statement_line_model.search(
|
||||
[("name", "=", "Epic Technologies")], limit=1,
|
||||
[("name", "=", "Epic Technologies")],
|
||||
limit=1,
|
||||
)
|
||||
self.assertEqual(line.partner_id, self.partner)
|
||||
|
||||
@@ -97,7 +97,8 @@ class AccountBankStatementImport(models.TransientModel):
|
||||
for line_vals in statement["transactions"]:
|
||||
if not line_vals.get("partner_id") and line_vals.get("name"):
|
||||
partner = partner_obj.search(
|
||||
[("name", "ilike", line_vals["name"])], limit=1,
|
||||
[("name", "ilike", line_vals["name"])],
|
||||
limit=1,
|
||||
)
|
||||
line_vals["partner_id"] = partner.id
|
||||
return res
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../../../../account_bank_statement_import_qif
|
||||
6
setup/account_bank_statement_import_qif/setup.py
Normal file
6
setup/account_bank_statement_import_qif/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
Reference in New Issue
Block a user