From a54563781aab544cc9b223edf4f82196bde7e0ca Mon Sep 17 00:00:00 2001 From: BT-anieto Date: Fri, 4 Aug 2023 10:01:20 +0200 Subject: [PATCH] [MIG] account_move_fiscal_year: Migration to 16.0 --- account_move_fiscal_year/__manifest__.py | 2 +- .../readme/CONTRIBUTORS.rst | 1 + .../tests/test_account_move_fiscal_year.py | 34 +++++++++---------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/account_move_fiscal_year/__manifest__.py b/account_move_fiscal_year/__manifest__.py index b08ad503..c985819b 100644 --- a/account_move_fiscal_year/__manifest__.py +++ b/account_move_fiscal_year/__manifest__.py @@ -5,7 +5,7 @@ "name": "Account Move Fiscal Year", "summary": """ Display the fiscal year on journal entries/item""", - "version": "15.0.1.0.1", + "version": "16.0.1.0.0", "license": "AGPL-3", "author": "ACSONE SA/NV, Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-financial-tools", diff --git a/account_move_fiscal_year/readme/CONTRIBUTORS.rst b/account_move_fiscal_year/readme/CONTRIBUTORS.rst index 20ea902c..372af3ca 100644 --- a/account_move_fiscal_year/readme/CONTRIBUTORS.rst +++ b/account_move_fiscal_year/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Benjamin Willig * Juany Davila +* Alberto Nieto de Pablos (https://braintec.com) diff --git a/account_move_fiscal_year/tests/test_account_move_fiscal_year.py b/account_move_fiscal_year/tests/test_account_move_fiscal_year.py index 7227e1fb..e6263afc 100644 --- a/account_move_fiscal_year/tests/test_account_move_fiscal_year.py +++ b/account_move_fiscal_year/tests/test_account_move_fiscal_year.py @@ -6,38 +6,36 @@ from odoo.tests.common import TransactionCase class TestAccountMoveFiscalYear(TransactionCase): - def setUp(self): - super(TestAccountMoveFiscalYear, self).setUp() - self.AccountObj = self.env["account.account"] - self.AccountJournalObj = self.env["account.journal"] - self.AccountMoveObj = self.env["account.move"] - self.DateRangeObj = self.env["account.fiscal.year"] + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.AccountObj = cls.env["account.account"] + cls.AccountJournalObj = cls.env["account.journal"] + cls.AccountMoveObj = cls.env["account.move"] + cls.DateRangeObj = cls.env["account.fiscal.year"] - self.bank_journal = self.AccountJournalObj.search( + cls.bank_journal = cls.AccountJournalObj.search( [("type", "=", "bank")], limit=1 ) - self.account_type_recv = self.env.ref("account.data_account_type_receivable") - self.account_type_rev = self.env.ref("account.data_account_type_revenue") - - self.account_recv = self.AccountObj.create( + cls.account_recv = cls.AccountObj.create( { - "code": "RECV_DR", + "code": "RECVDR", "name": "Receivable (test)", "reconcile": True, - "user_type_id": self.account_type_recv.id, + "account_type": "asset_receivable", } ) - self.account_sale = self.AccountObj.create( + cls.account_sale = cls.AccountObj.create( { - "code": "SALE_DR", + "code": "SALEDR", "name": "Receivable (sale)", "reconcile": True, - "user_type_id": self.account_type_rev.id, + "account_type": "income", } ) - self.date_range_2017 = self.DateRangeObj.create( + cls.date_range_2017 = cls.DateRangeObj.create( { "name": "2017", "date_from": "2017-01-01", @@ -45,7 +43,7 @@ class TestAccountMoveFiscalYear(TransactionCase): } ) - self.date_range_2018 = self.DateRangeObj.create( + cls.date_range_2018 = cls.DateRangeObj.create( { "name": "2018", "date_from": "2018-01-01",