Compare commits

..

26 commits

Author SHA1 Message Date
Frederik Jaeckel
5931736b16 Version 6.0.5 2023-06-06 16:09:11 +02:00
Frederik Jaeckel
761083cbbe export: set digits - format numbers 2023-06-06 15:41:58 +02:00
Frederik Jaeckel
da211efd93 formatting, optimize code 2023-06-06 15:22:57 +02:00
Frederik Jaeckel
b4a02d92d6 Etikett ver 6.0.4 zum Änderungssatz be4b32fa1653 hinzugefügt 2023-02-14 10:48:37 +01:00
Frederik Jaeckel
978823faf7 Version 6.0.4 2023-02-14 10:48:29 +01:00
Frederik Jaeckel
492befca04 setup.py 2023-02-14 10:47:30 +01:00
Frederik Jaeckel
0c2bae0663 test korrigiert 2022-09-16 10:40:28 +02:00
Frederik Jaeckel
70c4741c9d Etikett ver 6.0.3 zum Änderungssatz a67229652aa8 hinzugefügt 2022-09-13 23:09:45 +02:00
Frederik Jaeckel
eb8c1baa1b Version 6.0.3 2022-09-13 23:09:38 +02:00
Frederik Jaeckel
803262e202 test für splitbuchung mit transfer 2022-09-13 22:19:20 +02:00
Frederik Jaeckel
c5b3277622 splitbuchung: konvertiert transfers + test 2022-09-13 18:14:06 +02:00
Frederik Jaeckel
3796c7b7bc import: transfer buchungen korrigiert 2022-09-13 11:29:43 +02:00
Frederik Jaeckel
5544433b81 qif-import: ignoriert leere buchungen, prüft buchungstyp und kategorietyp 2022-09-12 18:52:22 +02:00
Frederik Jaeckel
e56b4f0cf8 import: für umbuchungen optimiert + test 2022-09-08 17:29:10 +02:00
Frederik Jaeckel
40ee9ed169 übersetzung 2022-09-08 12:53:48 +02:00
Frederik Jaeckel
63108a34eb transaktion: check für fehlende kategorie 2022-09-08 11:20:28 +02:00
Frederik Jaeckel
5216cecba7 Etikett ver 6.0.2 zum Änderungssatz 59e22aee60ef hinzugefügt 2022-09-05 10:22:29 +02:00
Frederik Jaeckel
491678da69 Version 6.0.2 2022-09-05 10:22:20 +02:00
Frederik Jaeckel
e9cde133c2 transaktionen: export + test 2022-09-05 10:13:20 +02:00
Frederik Jaeckel
8bb396f1d8 transaktion: import korrigiert 2022-09-03 20:36:16 +02:00
Frederik Jaeckel
78d02a60b7 import: party, transaction
übersetzung korrigiert
2022-09-02 14:33:12 +02:00
Frederik Jaeckel
a26e7119eb party: qif import 2022-09-01 17:13:55 +02:00
Frederik Jaeckel
be9c584fea import der transaktionen begonnen 2022-09-01 14:48:04 +02:00
Frederik Jaeckel
ac9400c085 kategorie: export als qif 2022-08-31 17:32:01 +02:00
Frederik Jaeckel
cdc0dfa49d Etikett ver 6.0.1 zum Änderungssatz 766463c8f9e1 hinzugefügt 2022-08-31 10:30:59 +02:00
Frederik Jaeckel
3eb4aebe0a Version 6.0.1 2022-08-31 10:30:49 +02:00
11 changed files with 108 additions and 71 deletions

View file

@ -9,11 +9,33 @@ pip install mds-cashbook-dataexchange
Requires Requires
======== ========
- Tryton 7.0 - Tryton 6.0
Changes Changes
======= =======
*7.0.0 - 01.12.2023* *6.0.5 - 06.06.2023*
- compatibility to Tryton 7.0 - optimize code
*6.0.4 - 14.02.2023*
- fix: test
*6.0.3 - 13.09.2022*
- add: import of split-bookings
- updt: transfers
*6.0.2 - 05.09.2022*
- category: qif-export
- party, transactions: qif-import/export
*6.0.1 - 31.08.2022*
- add: qif - category - import
*6.0.0 - 28.08.2022*
- init

View file

@ -7,11 +7,9 @@ from trytond.pool import Pool
from .category import Category from .category import Category
from .book import Book from .book import Book
from .qiftool import QifTool from .qiftool import QifTool
from .qif_import_wiz import ( from .qif_import_wiz import ImportQifWizard, ImportQifWizardStart, ImportQifWizardInfo
ImportQifWizard, ImportQifWizardStart, ImportQifWizardInfo)
from .qif_export import QifCategoryExport, QifBookExport from .qif_export import QifCategoryExport, QifBookExport
def register(): def register():
Pool.register( Pool.register(
QifTool, QifTool,

View file

@ -24,7 +24,8 @@ class ImportQifWizardStart(ModelView):
string='Cashbook', readonly=True, string='Cashbook', readonly=True,
model_name='cashbook.book', model_name='cashbook.book',
states={ states={
'invisible': ~Bool(Eval('book'))}) 'invisible': ~Bool(Eval('book')),
})
file_ = fields.Binary( file_ = fields.Binary(
string="QIF-File", required=True, string="QIF-File", required=True,
help='Quicken Interchange Format') help='Quicken Interchange Format')
@ -46,7 +47,8 @@ class ImportQifWizardInfo(ModelView):
book = fields.Many2One( book = fields.Many2One(
string='Cash Book', readonly=True, model_name='cashbook.book', string='Cash Book', readonly=True, model_name='cashbook.book',
states={ states={
'invisible': ~Bool(Eval('book'))}) 'invisible': ~Bool(Eval('book')),
})
allowimport = fields.Boolean( allowimport = fields.Boolean(
string='Import Enabled', string='Import Enabled',
states={'invisible': True}) states={'invisible': True})
@ -67,7 +69,8 @@ class ImportQifWizard(Wizard):
Button(string='Cancel', state='end', icon='tryton-cancel'), Button(string='Cancel', state='end', icon='tryton-cancel'),
Button( Button(
string='Read File', state='readf', string='Read File', state='readf',
icon='tryton-forward', default=True)]) icon='tryton-forward', default=True),
])
showinfo = StateView( showinfo = StateView(
model_name='cashbook_dataexchange.qif_imp_wiz.info', model_name='cashbook_dataexchange.qif_imp_wiz.info',
view='cashbook_dataexchange.qif_imp_wiz_info_form', view='cashbook_dataexchange.qif_imp_wiz_info_form',
@ -76,7 +79,10 @@ class ImportQifWizard(Wizard):
Button( Button(
string='Import Data', state='importf', string='Import Data', state='importf',
icon='tryton-import', default=True, icon='tryton-import', default=True,
states={'readonly': ~Eval('allowimport', False)})]) states={
'readonly': Eval('allowimport', False) == False,
}),
])
readf = StateTransition() readf = StateTransition()
importf = StateTransition() importf = StateTransition()
@ -88,7 +94,8 @@ class ImportQifWizard(Wizard):
values = { values = {
'company': Transaction().context.get('company'), 'company': Transaction().context.get('company'),
'book': None} 'book': None,
}
model = context.get('active_model', '') model = context.get('active_model', '')
if model == 'cashbook.book': if model == 'cashbook.book':
@ -163,7 +170,8 @@ class ImportQifWizard(Wizard):
['%s (in)' % x for x in in_categories] + ['%s (in)' % x for x in in_categories] +
[''] + [''] +
['%s (out)' % x for x in out_categories] ['%s (out)' % x for x in out_categories]
)) )
)
if len(to_create) > 0: if len(to_create) > 0:
self.showinfo.allowimport = True self.showinfo.allowimport = True
else: else:
@ -174,7 +182,8 @@ class ImportQifWizard(Wizard):
qif_content = QifTool.split_by_type(file_content) qif_content = QifTool.split_by_type(file_content)
if 'Bank' in qif_content.keys(): if 'Bank' in qif_content.keys():
to_create = QifTool.convert_parties_to_create( to_create = QifTool.convert_parties_to_create(
QifTool.qif_read_transactions(qif_content['Bank'])) QifTool.qif_read_transactions(qif_content['Bank'])
)
self.showinfo.info = gettext( self.showinfo.info = gettext(
'cashbook_dataexchange.msg_wiz_parties_found', 'cashbook_dataexchange.msg_wiz_parties_found',
numparties=len(to_create), numparties=len(to_create),
@ -257,7 +266,8 @@ class ImportQifWizard(Wizard):
Book.create_from_qif(self.showinfo.book, file_content) Book.create_from_qif(self.showinfo.book, file_content)
lines = Line.search([ lines = Line.search([
('cashbook.id', '=', self.showinfo.book.id), ('cashbook.id', '=', self.showinfo.book.id),
('state', '=', 'edit')]) ('state', '=', 'edit'),
])
if len(lines) > 0: if len(lines) > 0:
Line.wfcheck(lines) Line.wfcheck(lines)
elif model == 'party.party': elif model == 'party.party':

View file

@ -2,7 +2,7 @@
""" """
# Always prefer setuptools over distutils # Always prefer setuptools over distutils
from setuptools import setup from setuptools import setup, find_packages
# To use a consistent encoding # To use a consistent encoding
from codecs import open from codecs import open
from os import path from os import path
@ -39,7 +39,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]} modversion[l2[0]] = {'min':l2[1], 'max':l2[2], 'prefix':l2[3]}
# tryton-version # tryton-version
major_version = 7 major_version = 6
minor_version = 0 minor_version = 0
requires = ['python-slugify'] requires = ['python-slugify']
@ -51,21 +51,19 @@ for dep in info.get('depends', []):
prefix = modversion[dep]['prefix'] prefix = modversion[dep]['prefix']
if len(modversion[dep]['max']) > 0: if len(modversion[dep]['max']) > 0:
requires.append('%s_%s >= %s, <= %s' % ( requires.append('%s_%s >= %s, <= %s' %
prefix, dep, modversion[dep]['min'], (prefix, dep, modversion[dep]['min'], modversion[dep]['max']))
modversion[dep]['max']))
else : else :
requires.append('%s_%s >= %s' % ( requires.append('%s_%s >= %s' %
prefix, dep, modversion[dep]['min'])) (prefix, dep, modversion[dep]['min']))
else : else :
requires.append('%s_%s >= %s.%s, < %s.%s' % ( requires.append('%s_%s >= %s.%s, < %s.%s' %
'trytond', dep, major_version, minor_version, ('trytond', dep, major_version, minor_version,
major_version, minor_version + 1)) major_version, minor_version + 1))
requires.append('trytond >= %s.%s, < %s.%s' % ( requires.append('trytond >= %s.%s, < %s.%s' %
major_version, minor_version, major_version, minor_version + 1)) (major_version, minor_version, major_version, minor_version + 1))
setup( setup(name='%s_%s' % (PREFIX, MODULE),
name='%s_%s' % (PREFIX, MODULE),
version=info.get('version', '0.0.1'), version=info.get('version', '0.0.1'),
description='Tryton module to add import/export to cashbook.', description='Tryton module to add import/export to cashbook.',
long_description=long_description, long_description=long_description,
@ -91,19 +89,20 @@ 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 import export', keywords='tryton cashbook import export',
package_dir={'trytond.modules.%s' % MODULE: '.'}, package_dir={'trytond.modules.%s' % MODULE: '.'},
packages=[ packages=[
'trytond.modules.%s' % MODULE, 'trytond.modules.%s' % MODULE,
], ],
package_data={ package_data={
'trytond.modules.%s' % MODULE: (info.get('xml', []) + [ 'trytond.modules.%s' % MODULE: (info.get('xml', [])
'tryton.cfg', 'locale/*.po', 'tests/*.py', + ['tryton.cfg', 'locale/*.po', 'tests/*.py',
'report/*.fods', 'view/*.xml', 'report/*.fods', 'view/*.xml',
'versiondep.txt', 'README.rst']), 'versiondep.txt', 'README.rst']),
}, },
install_requires=requires, install_requires=requires,
zip_safe=False, zip_safe=False,
entry_points=""" entry_points="""

View file

@ -2,3 +2,17 @@
# 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 .test_module import CashbookExchangeTestCase
__all__ = ['suite']
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
CashbookExchangeTestCase))
return suite

View file

@ -21,8 +21,7 @@ class CategoryTestCase(object):
""" """
pool = Pool() pool = Pool()
Category = pool.get('cashbook.category') Category = pool.get('cashbook.category')
ImportWiz = pool.get( ImportWiz = pool.get('cashbook_dataexchange.qif_imp_wiz', type='wizard')
'cashbook_dataexchange.qif_imp_wiz', type='wizard')
company = self.prep_company() company = self.prep_company()
with Transaction().set_context({ with Transaction().set_context({
@ -359,8 +358,7 @@ I
'bookingtype': 'mvout', 'bookingtype': 'mvout',
'booktransf': books[1].id, 'booktransf': books[1].id,
'description': 'description':
'GA NR00002168 BLZ10000000 0; 05.12/06.42UHR ' + 'GA NR00002168 BLZ10000000 0; 05.12/06.42UHR TT TELTOW',
'TT TELTOW',
}, { }, {
'date': date(2013, 12, 5), 'date': date(2013, 12, 5),
'amount': Decimal('56.37'), 'amount': Decimal('56.37'),
@ -477,8 +475,7 @@ I
result = QifTool.qif_read_categories( result = QifTool.qif_read_categories(
'NGehalt\nI\n^\nNGehalt:Zulagen\nI\n^' + 'NGehalt\nI\n^\nNGehalt:Zulagen\nI\n^' +
'NTelekommunikation\nE\n^\nNTelekommunikation:' + 'NTelekommunikation\nE\n^\nNTelekommunikation:Online-Dienste\nE\n^')
'Online-Dienste\nE\n^')
self.assertEqual(result, { self.assertEqual(result, {
'in': { 'in': {
'Gehalt': { 'Gehalt': {

View file

@ -19,8 +19,7 @@ class PartyTestCase(object):
""" """
pool = Pool() pool = Pool()
Party = pool.get('party.party') Party = pool.get('party.party')
ImportWiz = pool.get( ImportWiz = pool.get('cashbook_dataexchange.qif_imp_wiz', type='wizard')
'cashbook_dataexchange.qif_imp_wiz', type='wizard')
company = self.prep_company() company = self.prep_company()
with Transaction().set_context({ with Transaction().set_context({
@ -46,8 +45,7 @@ class PartyTestCase(object):
self.assertEqual(list(result.keys()), ['view']) self.assertEqual(list(result.keys()), ['view'])
self.assertEqual(result['view']['defaults']['company'], company.id) self.assertEqual(result['view']['defaults']['company'], company.id)
self.assertEqual( self.assertEqual(result['view']['defaults']['info'],
result['view']['defaults']['info'],
"""The following 3 parties are now imported:\n """The following 3 parties are now imported:\n
Opening Balance Opening Balance
GA NR00002168 BLZ10000000 0 GA NR00002168 BLZ10000000 0
@ -63,8 +61,7 @@ Foodshop Zehlendorf""")
self.assertEqual(len(records), 4) self.assertEqual(len(records), 4)
self.assertEqual(records[0].rec_name, 'Foodshop Zehlendorf') self.assertEqual(records[0].rec_name, 'Foodshop Zehlendorf')
self.assertEqual( self.assertEqual(records[1].rec_name, 'GA NR00002168 BLZ10000000 0')
records[1].rec_name, 'GA NR00002168 BLZ10000000 0')
self.assertEqual(records[2].rec_name, 'm-ds') self.assertEqual(records[2].rec_name, 'm-ds')
self.assertEqual(records[3].rec_name, 'Opening Balance') self.assertEqual(records[3].rec_name, 'Opening Balance')

View file

@ -4,6 +4,7 @@
# full copyright notices and license terms. # full copyright notices and license terms.
from trytond.tests.test_tryton import ModuleTestCase
from trytond.modules.cashbook.tests.test_module import CashbookTestCase from trytond.modules.cashbook.tests.test_module import CashbookTestCase
from .category import CategoryTestCase from .category import CategoryTestCase
from .party import PartyTestCase from .party import PartyTestCase
@ -14,11 +15,12 @@ class CashbookExchangeTestCase(
CashbookTestCase, CashbookTestCase,
CategoryTestCase, CategoryTestCase,
PartyTestCase, PartyTestCase,
TransactionTestCase): TransactionTestCase,
ModuleTestCase):
'Test cashbook exchange module' 'Test cashbook exchange module'
module = 'cashbook_dataexchange' module = 'cashbook_dataexchange'
# end CashbookExchangeTestCase # end CashbookExchangeTestCase
del CashbookTestCase del ModuleTestCase

View file

@ -84,8 +84,7 @@ class TransactionTestCase(object):
Party = pool.get('party.party') Party = pool.get('party.party')
Category = pool.get('cashbook.category') Category = pool.get('cashbook.category')
Book = pool.get('cashbook.book') Book = pool.get('cashbook.book')
ImportWiz = pool.get( ImportWiz = pool.get('cashbook_dataexchange.qif_imp_wiz', type='wizard')
'cashbook_dataexchange.qif_imp_wiz', type='wizard')
company = self.prep_company() company = self.prep_company()
with Transaction().set_context({ with Transaction().set_context({
@ -224,8 +223,7 @@ Mreturn of bottles
Party = pool.get('party.party') Party = pool.get('party.party')
Category = pool.get('cashbook.category') Category = pool.get('cashbook.category')
Book = pool.get('cashbook.book') Book = pool.get('cashbook.book')
ImportWiz = pool.get( ImportWiz = pool.get('cashbook_dataexchange.qif_imp_wiz', type='wizard')
'cashbook_dataexchange.qif_imp_wiz', type='wizard')
company = self.prep_company() company = self.prep_company()
with Transaction().set_context({ with Transaction().set_context({

View file

@ -1,5 +1,5 @@
[tryton] [tryton]
version=7.0.0 version=6.0.5
depends: depends:
cashbook cashbook
xml: xml:

View file

@ -1 +1 @@
cashbook;7.0.31;7.0.999;mds cashbook;6.0.28;6.0.999;mds