diff --git a/__init__.py b/__init__.py index d29e36e..62501a1 100644 --- a/__init__.py +++ b/__init__.py @@ -11,6 +11,7 @@ from .wizard_openline import OpenCashBook, OpenCashBookStart from .configuration import Configuration, UserConfiguration from .category import Category from .reconciliation import Reconciliation +from .cbreport import CashbookReport def register(): Pool.register( @@ -24,6 +25,9 @@ def register(): Reconciliation, OpenCashBookStart, module='cashbook', type_='model') + Pool.register( + CashbookReport, + module='cashbook', type_='report') Pool.register( OpenCashBook, module='cashbook', type_='wizard') diff --git a/cbreport.py b/cbreport.py new file mode 100644 index 0000000..c56302e --- /dev/null +++ b/cbreport.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# 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. + +from trytond.report import Report +from trytond.i18n import gettext +from slugify import slugify + + +class CashbookReport(Report): + __name__ = 'cashbook.repbook' + + @classmethod + def execute(cls, ids, data): + """ edit filename + """ + pool = Pool() + IrDate = pool.get('ir.date') + ExpObj = pool.get(data['model'])(data['id']) + + (ext1, cont1, dirprint, title) = super(CashbookReport, cls).execute(ids, data) + + return ( + ext1, + cont1, + dirprint, + slugify('%(date)s-%(book)s-%(descr)s' % { + 'date': IrDate.today().isoformat().replace('-', ''), + 'book': gettext('cashbook.msg_name_cashbook'), + 'descr': ExpObj.name[:15], + }, + max_length=75, word_boundary=True, save_order=True), + ) + +# end CashbookReport diff --git a/cbreport.xml b/cbreport.xml new file mode 100644 index 0000000..75d382c --- /dev/null +++ b/cbreport.xml @@ -0,0 +1,27 @@ + + + + + + + Cashbook + cashbook.line + cashbook.repbook + cashbook/report/cashbook.fods + + + + form_print + cashbook.line,-1 + + + + form_print + cashbook.book,-1 + + + + + diff --git a/report/cashbook.fods b/report/cashbook.fods new file mode 100644 index 0000000..fe6cb67 --- /dev/null +++ b/report/cashbook.fods @@ -0,0 +1,242 @@ + + + + 2022-08-16T16:46:07.4074891592022-08-16T16:46:49.723385422PT42S1LibreOffice/6.0.7.3$Linux_X86_64 LibreOffice_project/00m0$Build-3 + + + 0 + 0 + 2257 + 451 + + + view1 + + + 0 + 1 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 100 + 60 + true + false + + + Tabelle1 + 1640 + 0 + 100 + 60 + false + true + true + true + 12632256 + true + true + true + true + false + false + false + 1000 + 1000 + 1 + 1 + true + false + + + + + true + false + false + 0 + true + + + true + 3 + true + false + true + true + 12632256 + true + true + true + false + true + false + true + 1 + false + 1000 + 1000 + false + 1 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ??? + + + + Seite 1 + + + + + + + ???(???) + + + 00.00.0000, 00:00:00 + + + + + Seite 1/ 99 + + + + + + + + + + + + Kassenbuch + + + + + + + \ No newline at end of file diff --git a/setup.py b/setup.py index d73c38e..c248642 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f: major_version = 6 minor_version = 0 -requires = [] +requires = ['python-slugify'] for dep in info.get('depends', []): if not re.match(r'(ir|res|webdav)(\W|$)', dep): if dep in modversion.keys(): @@ -98,7 +98,7 @@ setup(name='%s_%s' % (PREFIX, MODULE), 'trytond.modules.%s' % MODULE: (info.get('xml', []) + ['tryton.cfg', 'locale/*.po', 'tests/*.py', 'view/*.xml', 'icon/*.svg', - 'versiondep.txt', 'README.rst']), + 'report/*.fods', 'versiondep.txt', 'README.rst']), }, install_requires=requires, diff --git a/tryton.cfg b/tryton.cfg index 5a132ab..4d9b25a 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -10,6 +10,7 @@ xml: group.xml message.xml types.xml + cbreport.xml category.xml reconciliation.xml configuration.xml