diff --git a/bank_statement_check_number/__manifest__.py b/bank_statement_check_number/__manifest__.py index 792ea5a3ed..35f47e77d4 100644 --- a/bank_statement_check_number/__manifest__.py +++ b/bank_statement_check_number/__manifest__.py @@ -4,8 +4,8 @@ { "name": "Bank Statement Check Number", "summary": "Add the check number in the bank statements", - "version": "14.0.1.0.0", - "depends": ["account_move_line_check_number"], + "version": "16.0.1.0.0", + "depends": ["account_move_line_check_number", "account_statement_base"], "author": "Ecosoft, Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-reconcile", "category": "Accounting & Finance", diff --git a/bank_statement_check_number/models/account_bank_statement.py b/bank_statement_check_number/models/account_bank_statement.py index f098e00de3..001bacdbe3 100644 --- a/bank_statement_check_number/models/account_bank_statement.py +++ b/bank_statement_check_number/models/account_bank_statement.py @@ -8,7 +8,6 @@ class AccountBankStatementLine(models.Model): _inherit = "account.bank.statement.line" check_number = fields.Char( - string="Check Number", copy=False, index=True, ) diff --git a/bank_statement_check_number/tests/__init__.py b/bank_statement_check_number/tests/__init__.py new file mode 100644 index 0000000000..a80ad7e850 --- /dev/null +++ b/bank_statement_check_number/tests/__init__.py @@ -0,0 +1 @@ +from . import test_check_number diff --git a/bank_statement_check_number/tests/test_check_number.py b/bank_statement_check_number/tests/test_check_number.py new file mode 100644 index 0000000000..cc328bb457 --- /dev/null +++ b/bank_statement_check_number/tests/test_check_number.py @@ -0,0 +1,39 @@ +from odoo.tests import tagged + +from odoo.addons.account.tests.common import AccountTestInvoicingCommon + + +@tagged("post_install", "-at_install") +class TestCheckNumber(AccountTestInvoicingCommon): + @classmethod + def setUpClass(cls, chart_template_ref=None): + super().setUpClass(chart_template_ref=chart_template_ref) + + cls.bank_journal = cls.company_data["default_journal_bank"] + cls.currency = cls.currency_data["currency"] + cls.statement = cls.env["account.bank.statement"].create( + { + "name": "test_statement", + "line_ids": [ + ( + 0, + 0, + { + "date": "2019-01-01", + "payment_ref": "line_1", + "partner_id": cls.partner_a.id, + "foreign_currency_id": cls.currency.id, + "journal_id": cls.bank_journal.id, + "amount": 1250.0, + "amount_currency": 2500.0, + "check_number": "111", + }, + ), + ], + } + ) + cls.statement_line = cls.statement.line_ids + + def test_01_check_number(self): + + self.assertEqual(self.statement_line.check_number, "111") diff --git a/bank_statement_check_number/views/account_bank_statement_views.xml b/bank_statement_check_number/views/account_bank_statement_views.xml index 8006ff7155..e67a2b71e3 100644 --- a/bank_statement_check_number/views/account_bank_statement_views.xml +++ b/bank_statement_check_number/views/account_bank_statement_views.xml @@ -1,32 +1,30 @@ - + account.bank.statement.form - account.bank.statement - + account.bank.statement.line + - - - + + + - - - account.bank.statement.line.tree + + account.bank.statement.form account.bank.statement.line - 8 - + - - - + + + + diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000000..8ef5fd9e4b --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-account_move_line_check_number@git+https://github.com/OCA/account-financial-tools.git@refs/pull/1669/head#subdirectory=setup/account_move_line_check_number