Tryton 6.8: infos tests, select removed

This commit is contained in:
Frederik Jaeckel 2023-06-16 14:35:03 +02:00
parent fc1975f0ad
commit 07b339914d
7 changed files with 19 additions and 35 deletions

View file

@ -9,7 +9,7 @@ pip install mds-cashbook-report
Requires Requires
======== ========
- Tryton 6.0 - Tryton 6.8
Info Info
==== ====
@ -29,6 +29,7 @@ so that you can display several evaluations at the same time.
Changes Changes
======= =======
*6.0.0 - 28.10.2022* *6.8.8 - 16.06.2023*
- compatibility to Tryton 6.8
- init

14
line.py
View file

@ -19,29 +19,25 @@ class EvaluationLine(ModelSQL, ModelView):
__name__ = 'cashbook_report.eval_line' __name__ = 'cashbook_report.eval_line'
evaluation = fields.Many2One( evaluation = fields.Many2One(
string='Evaluation', required=True, string='Evaluation', required=True, ondelete='CASCADE',
select=True, ondelete='CASCADE',
model_name='cashbook_report.evaluation') model_name='cashbook_report.evaluation')
cashbook = fields.Many2One( cashbook = fields.Many2One(
string='Cashbook', select=True, ondelete='CASCADE', string='Cashbook', ondelete='CASCADE', model_name='cashbook.book',
model_name='cashbook.book',
states={ states={
'required': Eval('eval_dtype', '').in_(cashbook_types), 'required': Eval('eval_dtype', '').in_(cashbook_types),
}, depends=['eval_dtype']) }, depends=['eval_dtype'])
dtype = fields.Many2One( dtype = fields.Many2One(
string='Type', select=True, ondelete='CASCADE', string='Type', ondelete='CASCADE', model_name='cashbook.type',
model_name='cashbook.type',
states={ states={
'required': Eval('eval_dtype', '').in_(booktype_types), 'required': Eval('eval_dtype', '').in_(booktype_types),
}, depends=['eval_dtype']) }, depends=['eval_dtype'])
currency = fields.Many2One( currency = fields.Many2One(
string='Currency', select=True, ondelete='CASCADE', string='Currency', ondelete='CASCADE', model_name='currency.currency',
model_name='currency.currency',
states={ states={
'required': Eval('eval_dtype', '') == 'currencies', 'required': Eval('eval_dtype', '') == 'currencies',
}, depends=['eval_dtype']) }, depends=['eval_dtype'])
category = fields.Many2One( category = fields.Many2One(
string='Category', select=True, ondelete='CASCADE', string='Category', ondelete='CASCADE',
model_name='cashbook.bookcategory', model_name='cashbook.bookcategory',
states={ states={
'required': Eval('eval_dtype', '').in_(category_types), 'required': Eval('eval_dtype', '').in_(category_types),

View file

@ -40,7 +40,7 @@ with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f:
# tryton-version # tryton-version
major_version = 6 major_version = 6
minor_version = 0 minor_version = 8
requires = [] requires = []
for dep in info.get('depends', []): for dep in info.get('depends', []):
@ -91,6 +91,7 @@ setup(
'License :: OSI Approved :: GNU General Public License (GPL)', 'License :: OSI Approved :: GNU General Public License (GPL)',
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
], ],
keywords='tryton cashbook report', keywords='tryton cashbook report',

View file

@ -2,17 +2,3 @@
# This file is part of the cashbook-module from m-ds for Tryton. # 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 # The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms. # full copyright notices and license terms.
import trytond.tests.test_tryton
import unittest
from trytond.modules.cashbook_report.tests.test_report import ReportTestCase
__all__ = ['suite']
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(ReportTestCase))
return suite

View file

@ -7,7 +7,7 @@ from trytond.tests.test_tryton import with_transaction, activate_module
from trytond.pool import Pool from trytond.pool import Pool
from trytond.transaction import Transaction from trytond.transaction import Transaction
from trytond.exceptions import UserError from trytond.exceptions import UserError
from trytond.modules.cashbook_investment.tests import \ from trytond.modules.cashbook_investment.tests.test_module import \
CashbookInvestmentTestCase CashbookInvestmentTestCase
from datetime import date from datetime import date
from decimal import Decimal from decimal import Decimal
@ -705,8 +705,8 @@ class ReportTestCase(CashbookInvestmentTestCase):
# must fail # must fail
self.assertRaisesRegex( self.assertRaisesRegex(
UserError, UserError,
'A value is required for field "Data type" in ' + 'A value is required for field "Data type" in "None" ' +
'"Evaluation Line Relation".', 'of "Evaluation Line Relation".',
Evaluation.create, Evaluation.create,
[{ [{
'name': 'Evaluation 1', 'name': 'Evaluation 1',
@ -723,8 +723,8 @@ class ReportTestCase(CashbookInvestmentTestCase):
# must fail # must fail
self.assertRaisesRegex( self.assertRaisesRegex(
UserError, UserError,
'A value is required for field "Cashbook" in ' + 'A value is required for field "Cashbook" in "None" ' +
'"Evaluation Line Relation".', 'of "Evaluation Line Relation".',
Evaluation.create, Evaluation.create,
[{ [{
'name': 'Evaluation 3', 'name': 'Evaluation 3',

View file

@ -1,5 +1,5 @@
[tryton] [tryton]
version=6.0.0 version=6.8.8
depends: depends:
res res
cashbook cashbook

View file

@ -1,2 +1,2 @@
cashbook;6.0.19;6.0.999;mds cashbook;6.8.28;6.8.999;mds
cashbook_bookcategory;6.0.2;6.0.999;mds cashbook_bookcategory;6.8.4;6.8.999;mds