diff --git a/.env b/.env index d0efcdf..de6cefe 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -PYTHONPATH=~/Projekte/tr70/lib/python3.10/site-packages \ No newline at end of file +PYTHONPATH=~/Projekte/tr50/lib/python3.10/site-packages \ No newline at end of file diff --git a/.gitignore b/.gitignore index e349607..f872304 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist/* mds_account_invoice_xrechnung.egg-info/* __pycache__/* locale/convert_de2en.py +.env diff --git a/README.rst b/README.rst index 0aac6c8..84660f3 100644 --- a/README.rst +++ b/README.rst @@ -9,11 +9,23 @@ pip install mds-account-invoice-xrechnung Requires ======== -- Tryton 7.0 +- Tryton 5.0 Changes ======= -*7.0.0 - 22.12.2023* +*5.0.10 - 11.02.2025* -- compatiblity to Tryton 7.0 +- 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 diff --git a/invoice.py b/invoice.py index bbdeca2..f5a70cb 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')))) - cls.unit.depends.update(['type', 'quantity']) + Bool(Eval('quantity', None)))) + cls.unit.depends.extend(['type', 'quantity']) # end Invoice diff --git a/setup.py b/setup.py index 645635e..d2a470f 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,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 = 7 +major_version = 5 minor_version = 0 requires = ['python-slugify', 'pypdf', 'factur-x'] @@ -83,6 +83,8 @@ 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', diff --git a/tests/__init__.py b/tests/__init__.py index 5256907..171049f 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,3 +2,18 @@ # 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 d502547..455f1d7 100644 --- a/tests/test_invoice.py +++ b/tests/test_invoice.py @@ -18,16 +18,10 @@ 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, - sequence_type=SequenceType(ModelData.get_id( - 'account_invoice', 'sequence_type_account_invoice')), - company=fiscalyear.company, - ) + sequence = Sequence(name=fiscalyear.name, code='account.invoice') + sequence.company = fiscalyear.company sequence.save() fiscalyear.invoice_sequences = [] invoice_sequence = InvoiceSequence() @@ -132,7 +126,7 @@ class InvoiceTestCase(ModuleTestCase): 'addresses': [('create', [{ 'invoice': True, 'street': 'Applicant Street 1', - 'postal_code': '12345', + 'zip': '12345', 'city': 'Usertown', 'country': country_de.id, }])], @@ -199,7 +193,7 @@ class InvoiceTestCase(ModuleTestCase): self.assertEqual( list(result['view']['defaults'].keys()), [ 'as_zip', 'edocument', 'invoice', 'state', - 'invoice.']) + 'invoice.rec_name']) data = {} for x in result['view']['defaults'].keys(): @@ -225,7 +219,6 @@ 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 272e243..eef9beb 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,9 +1,10 @@ [tryton] -version=7.0.0 +version=5.0.9 depends: account_invoice bank edocument_xrechnung + tryton6_backport xml: message.xml configuration.xml diff --git a/versiondep.txt b/versiondep.txt index 258b3ff..9ce7723 100644 --- a/versiondep.txt +++ b/versiondep.txt @@ -1 +1,2 @@ -edocument_xrechnung;7.0.5;7.0.999;mds +edocument_xrechnung;5.0.13;5.0.999;mds +tryton6_backport;5.0.3;5.0.999;mds diff --git a/view/configuration_form.xml b/view/configuration_form.xml index 9e4b01f..4bb397e 100644 --- a/view/configuration_form.xml +++ b/view/configuration_form.xml @@ -4,7 +4,7 @@ full copyright notices and license terms. --> - +