diff --git a/README.rst b/README.rst index 7b12126..49aa477 100644 --- a/README.rst +++ b/README.rst @@ -9,11 +9,11 @@ pip install mds-cashbook-bookcategory Requires ======== -- Tryton 6.0 +- Tryton 6.8 Changes ======= -*6.0.0 - 07.11.2022* +*6.8.4 - 05.06.2023* -- init +- code optimized, porting to Tryton 6.8 diff --git a/book.py b/book.py index 00a2d5e..ee219a4 100644 --- a/book.py +++ b/book.py @@ -22,10 +22,10 @@ class CategoryCashbookRel(ModelSQL): __name__ = 'cashbook.bookcategory-rel' category = fields.Many2One( - string='Category', required=True, select=True, + string='Category', required=True, model_name='cashbook.bookcategory', ondelete='CASCADE') cashbook = fields.Many2One( - string='Cashbook', required=True, select=True, + string='Cashbook', required=True, model_name='cashbook.book', ondelete='CASCADE') # end CategoryCashbookRel diff --git a/category.py b/category.py index b428e51..7b97dcb 100644 --- a/category.py +++ b/category.py @@ -17,7 +17,7 @@ class Category(tree(separator=' / '), ModelSQL, ModelView): name = fields.Char(string='Name', required=True, translate=True) parent = fields.Many2One( - string='Parent', select=True, + string='Parent', model_name='cashbook.bookcategory', ondelete='CASCADE') childs = fields.One2Many( string='Children', field='parent', diff --git a/setup.py b/setup.py index 728ff37..23a7db4 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f: # tryton-version major_version = 6 -minor_version = 0 +minor_version = 8 requires = [] for dep in info.get('depends', []): @@ -89,6 +89,7 @@ setup(name='%s_%s' % (PREFIX, MODULE), 'License :: OSI Approved :: GNU General Public License (GPL)', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', ], keywords='tryton cashbook category', diff --git a/tests/__init__.py b/tests/__init__.py index a6930ba..cf7e957 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,25 +2,3 @@ # This file is part of the cashbook-module from m-ds for Tryton. # The COPYRIGHT file at the top level of this repository contains the # full copyright notices and license terms. - -import trytond.tests.test_tryton -import unittest - -from .test_category import CategoryTestCase - - -__all__ = ['suite'] - - -class CashbookCategoryTestCase(CategoryTestCase): - 'Test cashbook module' - module = 'cashbook_bookcategory' - -# end CashbookCategoryTestCase - - -def suite(): - suite = trytond.tests.test_tryton.suite() - suite.addTests(unittest.TestLoader().loadTestsFromTestCase( - CashbookCategoryTestCase)) - return suite diff --git a/tests/test_category.py b/tests/test_category.py index 4bf63d5..ddc689d 100644 --- a/tests/test_category.py +++ b/tests/test_category.py @@ -6,7 +6,7 @@ from trytond.tests.test_tryton import with_transaction from trytond.pool import Pool from trytond.transaction import Transaction -from trytond.modules.cashbook.tests import CashbookTestCase +from trytond.modules.cashbook.tests.test_module import CashbookTestCase class CategoryTestCase(CashbookTestCase): @@ -98,3 +98,6 @@ class CategoryTestCase(CashbookTestCase): self.assertEqual(len(book.categories), 0) # end CategoryTestCase + + +del CashbookTestCase diff --git a/tryton.cfg b/tryton.cfg index ba1dc2c..458dffc 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=6.0.0 +version=6.8.4 depends: cashbook xml: diff --git a/versiondep.txt b/versiondep.txt index e56514a..4191fe8 100644 --- a/versiondep.txt +++ b/versiondep.txt @@ -1,2 +1,2 @@ -cashbook;6.0.19;6.0.999;mds +cashbook;6.8.28;6.8.999;mds