diff --git a/.env b/.env index de6cefe..d0efcdf 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -PYTHONPATH=~/Projekte/tr50/lib/python3.10/site-packages \ No newline at end of file +PYTHONPATH=~/Projekte/tr70/lib/python3.10/site-packages \ No newline at end of file diff --git a/.gitignore b/.gitignore index f872304..e349607 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ dist/* mds_account_invoice_xrechnung.egg-info/* __pycache__/* locale/convert_de2en.py -.env diff --git a/COPYRIGHT b/COPYRIGHT index f7d3062..b597702 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,5 +1,3 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. Copyright (C) 2021-2025 martin-data services. Copyright (C) 2025 Mathias Behrle diff --git a/README.rst b/README.rst index 84660f3..0aac6c8 100644 --- a/README.rst +++ b/README.rst @@ -9,23 +9,11 @@ pip install mds-account-invoice-xrechnung Requires ======== -- Tryton 5.0 +- Tryton 7.0 Changes ======= -*5.0.10 - 11.02.2025* +*7.0.0 - 22.12.2023* -- Allow the export of paid invoices. (Mathias Behrle ) - -*5.0.8 - 28.01.2025* - -- fix: select 1st invoice-report (Mathias Behrle ) - -*5.0.7 - 17.12.2024* - -- optimize pdf-generate - -*5.0.6 - 11.12.2024* - -- compatiblitiy to Tryton 5.0 +- compatiblity to Tryton 7.0 diff --git a/invoice.py b/invoice.py index f5a70cb..bbdeca2 100644 --- a/invoice.py +++ b/invoice.py @@ -17,7 +17,7 @@ class InvoiceLine(metaclass=PoolMeta): cls.unit.states['required'], And( Eval('type') == 'line', - Bool(Eval('quantity', None)))) - cls.unit.depends.extend(['type', 'quantity']) + Bool(Eval('quantity')))) + cls.unit.depends.update(['type', 'quantity']) # end Invoice diff --git a/setup.py b/setup.py index d2a470f..d0f871b 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,6 @@ here = path.abspath(path.dirname(__file__)) MODULE = 'account_invoice_xrechnung' PREFIX = 'mds' -# Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() @@ -35,7 +34,7 @@ with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f: modversion[l2[0]] = {'min': l2[1], 'max': l2[2], 'prefix': l2[3]} # tryton-version -major_version = 5 +major_version = 7 minor_version = 0 requires = ['python-slugify', 'pypdf', 'factur-x'] @@ -83,11 +82,11 @@ setup( 'Natural Language :: English', 'Operating System :: OS Independent', 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], keywords='tryton account invoice xrechnung edocument', diff --git a/tests/__init__.py b/tests/__init__.py index 171049f..5256907 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,18 +2,3 @@ # This file is part of the account-invoice-xrechnung-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_invoice import InvoiceTestCase - - -__all__ = ['suite'] - - -def suite(): - suite = trytond.tests.test_tryton.suite() - suite.addTests(unittest.TestLoader().loadTestsFromTestCase( - InvoiceTestCase)) - return suite diff --git a/tests/test_invoice.py b/tests/test_invoice.py index 455f1d7..d502547 100644 --- a/tests/test_invoice.py +++ b/tests/test_invoice.py @@ -18,10 +18,16 @@ from .xml_data import xml_from_pdf def set_invoice_sequences(fiscalyear): pool = Pool() Sequence = pool.get('ir.sequence.strict') + SequenceType = pool.get('ir.sequence.type') InvoiceSequence = pool.get('account.fiscalyear.invoice_sequence') + ModelData = pool.get('ir.model.data') - sequence = Sequence(name=fiscalyear.name, code='account.invoice') - sequence.company = fiscalyear.company + sequence = Sequence( + name=fiscalyear.name, + sequence_type=SequenceType(ModelData.get_id( + 'account_invoice', 'sequence_type_account_invoice')), + company=fiscalyear.company, + ) sequence.save() fiscalyear.invoice_sequences = [] invoice_sequence = InvoiceSequence() @@ -126,7 +132,7 @@ class InvoiceTestCase(ModuleTestCase): 'addresses': [('create', [{ 'invoice': True, 'street': 'Applicant Street 1', - 'zip': '12345', + 'postal_code': '12345', 'city': 'Usertown', 'country': country_de.id, }])], @@ -193,7 +199,7 @@ class InvoiceTestCase(ModuleTestCase): self.assertEqual( list(result['view']['defaults'].keys()), [ 'as_zip', 'edocument', 'invoice', 'state', - 'invoice.rec_name']) + 'invoice.']) data = {} for x in result['view']['defaults'].keys(): @@ -219,6 +225,7 @@ class InvoiceTestCase(ModuleTestCase): action['report_name'], 'account_invoice_xrechnung.export') self.assertEqual(action['type'], 'ir.action.report') + self.assertEqual(action['records'], 'selected') # 2nd step, wizard told us which report we must execute ReportExport = pool.get( diff --git a/tryton.cfg b/tryton.cfg index eef9beb..272e243 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,10 +1,9 @@ [tryton] -version=5.0.9 +version=7.0.0 depends: account_invoice bank edocument_xrechnung - tryton6_backport xml: message.xml configuration.xml diff --git a/versiondep.txt b/versiondep.txt index 9ce7723..258b3ff 100644 --- a/versiondep.txt +++ b/versiondep.txt @@ -1,2 +1 @@ -edocument_xrechnung;5.0.13;5.0.999;mds -tryton6_backport;5.0.3;5.0.999;mds +edocument_xrechnung;7.0.5;7.0.999;mds diff --git a/view/configuration_form.xml b/view/configuration_form.xml index 4bb397e..9e4b01f 100644 --- a/view/configuration_form.xml +++ b/view/configuration_form.xml @@ -4,7 +4,7 @@ full copyright notices and license terms. --> - +