From bb215d7fc3a51bebb698d3a48b46e15f163df972 Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Fri, 25 Oct 2024 18:04:35 +0200 Subject: [PATCH] [MIG] account_statement_import_move_line: Migration to version 17.0 TT51242 --- .../__manifest__.py | 4 ++-- ...account_bank_statement_import_move_line.py | 17 ++++----------- .../views/account_bank_statement_view.xml | 21 ++++++++++++------- .../wizards/account_statement_line_create.py | 6 +++++- .../account_statement_line_create_view.xml | 8 +++---- 5 files changed, 29 insertions(+), 27 deletions(-) diff --git a/account_statement_import_move_line/__manifest__.py b/account_statement_import_move_line/__manifest__.py index 2c0c1abab..3ffbd8bac 100644 --- a/account_statement_import_move_line/__manifest__.py +++ b/account_statement_import_move_line/__manifest__.py @@ -3,13 +3,13 @@ { "name": "Bank statement import move lines", - "version": "15.0.1.0.0", + "version": "17.0.1.0.0", "category": "Accounting", "summary": "Import journal items into bank statement", "author": "Tecnativa, " "Odoo Community Association (OCA)", "maintainers": ["pedrobaeza"], "website": "https://github.com/OCA/bank-statement-import", - "depends": ["account"], + "depends": ["account_statement_base"], "data": [ "security/ir.model.access.csv", "wizards/account_statement_line_create_view.xml", diff --git a/account_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py b/account_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py index 9ac23f846..f412ab756 100644 --- a/account_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py +++ b/account_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py @@ -8,32 +8,23 @@ class TestAccountBankStatementImportMoveLine(TransactionCase): @classmethod def setUpClass(cls): - super(TestAccountBankStatementImportMoveLine, cls).setUpClass() - - cls.account_type = cls.env["account.account.type"].create( - {"name": "Test Account Type", "type": "other", "internal_group": "asset"} - ) - + super().setUpClass() cls.a_receivable = cls.env["account.account"].create( { "code": "TAA", "name": "Test Receivable Account", - "internal_type": "receivable", - "user_type_id": cls.account_type.id, + "account_type": "asset_receivable", } ) - cls.partner = cls.env["res.partner"].create( - {"name": "Test Partner 2", "parent_id": False} - ) + cls.partner = cls.env["res.partner"].create({"name": "Test Partner 2"}) cls.journal = cls.env["account.journal"].create( - {"name": "Test Journal", "type": "sale", "code": "TJS0"} + {"name": "Test Journal Sale", "type": "sale", "code": "TJS0"} ) cls.journal_bank = cls.env["account.journal"].create( {"name": "Test Journal Bank", "type": "bank", "code": "TJB0"} ) cls.invoice = cls.env["account.move"].create( { - "name": "Test Invoice 3", "partner_id": cls.partner.id, "move_type": "out_invoice", "journal_id": cls.journal.id, diff --git a/account_statement_import_move_line/views/account_bank_statement_view.xml b/account_statement_import_move_line/views/account_bank_statement_view.xml index ab637dcf3..274ec88af 100644 --- a/account_statement_import_move_line/views/account_bank_statement_view.xml +++ b/account_statement_import_move_line/views/account_bank_statement_view.xml @@ -3,18 +3,25 @@ account.bank.statement.form.population account.bank.statement - + - + + diff --git a/account_statement_import_move_line/wizards/account_statement_line_create.py b/account_statement_import_move_line/wizards/account_statement_line_create.py index 33ccdff66..6a30bd146 100644 --- a/account_statement_import_move_line/wizards/account_statement_line_create.py +++ b/account_statement_import_move_line/wizards/account_statement_line_create.py @@ -55,7 +55,11 @@ def _prepare_move_line_domain(self): self.ensure_one() domain = [ ("reconciled", "=", False), - ("account_id.internal_type", "in", ("payable", "receivable")), + ( + "account_id.account_type", + "in", + ("asset_receivable", "liability_payable"), + ), ("company_id", "=", self.env.company.id), ] if self.journal_ids: diff --git a/account_statement_import_move_line/wizards/account_statement_line_create_view.xml b/account_statement_import_move_line/wizards/account_statement_line_create_view.xml index db3a20bbf..f59407ebe 100644 --- a/account_statement_import_move_line/wizards/account_statement_line_create_view.xml +++ b/account_statement_import_move_line/wizards/account_statement_line_create_view.xml @@ -11,13 +11,13 @@