formatting

This commit is contained in:
Frederik Jaeckel 2023-06-30 11:21:48 +02:00
parent 22a0fb9a14
commit 4736bd6f18
7 changed files with 62 additions and 60 deletions

View file

@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
# This file is part of Tryton.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
# 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.
from trytond.pool import Pool
from .wizard_runreport import RunXRechnungReport, RunXRechnungReportStart
from .invoice import InvoiceLine
from .xreport import XReport
def register():
Pool.register(
InvoiceLine,

View file

@ -1,7 +1,7 @@
# -*- 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.
# 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.
from trytond.pool import PoolMeta
from trytond.pyson import Eval, And, Or

View file

@ -2,7 +2,7 @@
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
@ -51,19 +51,21 @@ for dep in info.get('depends', []):
prefix = modversion[dep]['prefix']
if len(modversion[dep]['max']) > 0:
requires.append('%s_%s >= %s, <= %s' %
(prefix, dep, modversion[dep]['min'], modversion[dep]['max']))
requires.append('%s_%s >= %s, <= %s' % (
prefix, dep, modversion[dep]['min'],
modversion[dep]['max']))
else:
requires.append('%s_%s >= %s' %
(prefix, dep, modversion[dep]['min']))
requires.append('%s_%s >= %s' % (
prefix, dep, modversion[dep]['min']))
else:
requires.append('%s_%s >= %s.%s, < %s.%s' %
('trytond', dep, major_version, minor_version,
requires.append('%s_%s >= %s.%s, < %s.%s' % (
'trytond', dep, major_version, minor_version,
major_version, minor_version + 1))
requires.append('trytond >= %s.%s, < %s.%s' %
(major_version, minor_version, major_version, minor_version + 1))
requires.append('trytond >= %s.%s, < %s.%s' % (
major_version, minor_version, major_version, minor_version + 1))
setup(name='%s_%s' % (PREFIX, MODULE),
setup(
name='%s_%s' % (PREFIX, MODULE),
version=info.get('version', '0.0.1'),
description='Tryton module to add xrechnung-export to invoice.',
long_description=long_description,
@ -87,6 +89,7 @@ setup(name='%s_%s' % (PREFIX, MODULE),
'License :: OSI Approved :: GNU General Public License (GPL)',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
keywords='tryton account invoice xrechnung edocument',
@ -95,7 +98,8 @@ setup(name='%s_%s' % (PREFIX, MODULE),
'trytond.modules.%s' % MODULE,
],
package_data={
'trytond.modules.%s' % MODULE: (info.get('xml', [])
'trytond.modules.%s' % MODULE: (
info.get('xml', [])
+ ['tryton.cfg', 'locale/*.po', 'tests/*.py',
'view/*.xml',
'report/*.fodt', 'versiondep.txt', 'README.rst']),

View file

@ -1,24 +1,19 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# -*- coding: utf-8 -*-
# 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 trytond.modules.account_invoice_xrechnung.tests.test_invoice import InvoiceTestCase
from .test_invoice import InvoiceTestCase
__all__ = ['suite']
class XRechnungTestCase(\
InvoiceTestCase,\
):
'Test xrechnung module'
module = 'account_invoice_xrechnung'
# end XRechnungTestCase
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(XRechnungTestCase))
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
InvoiceTestCase))
return suite

View file

@ -1,7 +1,7 @@
# -*- 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.
# 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.
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
@ -18,4 +18,5 @@ class InvoiceTestCase(ModuleTestCase):
# end InvoiceTestCase
del ModuleTestCase

View file

@ -26,12 +26,13 @@ class RunXRechnungReportStart(ModelView):
'eDocument Export'
__name__ = 'account_invoice_xrechnung.runrep.start'
invoice = fields.Many2One(string='Invoice', readonly=True,
invoice = fields.Many2One(
string='Invoice', readonly=True,
model_name='account.invoice', required=True)
state = fields.Char(string='State', readonly=True,
states={'invisible': True})
edocument = fields.Selection(string='Type', required=True,
selection=sel_edocument)
state = fields.Char(
string='State', readonly=True, states={'invisible': True})
edocument = fields.Selection(
string='Type', required=True, selection=sel_edocument)
as_zip = fields.Boolean(string='ZIP-File')
@classmethod

View file

@ -1,7 +1,7 @@
# -*- 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.
# 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 zipfile
from io import BytesIO
@ -43,7 +43,7 @@ class XReport(Report):
},
max_length=100, word_boundary=True, save_order=True)
if data['as_zip'] == True:
if data['as_zip'] is True:
return (
'zip',
cls.compress_as_zip('%(fname)s.%(ext)s' % {