From 7d20e3d091183fb2e17af4514efde5fe720a2746 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Fri, 30 Jun 2023 11:36:17 +0200 Subject: [PATCH] formatting --- __init__.py | 2 +- edocument.py | 23 ++++++++++------------- party.py | 5 ++--- tests/__init__.py | 19 +++++++------------ 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/__init__.py b/__init__.py index 84ce866..fe1a4a0 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# This file is part of the cashbook-module from m-ds for Tryton. +# This file is part of the edocument-module for Tryton from m-ds.de. # The COPYRIGHT file at the top level of this repository contains the # full copyright notices and license terms. diff --git a/edocument.py b/edocument.py index 44b4123..ef0ae91 100644 --- a/edocument.py +++ b/edocument.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- -# This file is part of the edcoment-module for Tryton. +# This file is part of the edocument-module for Tryton from m-ds.de. # The COPYRIGHT file at the top level of this repository contains the # full copyright notices and license terms. import genshi.template -import os, html +import os +import html from trytond.exceptions import UserError from trytond.i18n import gettext from trytond.modules.edocument_uncefact.edocument import Invoice @@ -45,17 +46,15 @@ class Invoice(Invoice): if len(line.invoice_taxes) != 1: raise UserError(gettext( 'edocument_xrechnung.msg_linetax_invalid_number', - linename = line.rec_name, - numtax = len(line.invoice_taxes), - )) + linename=line.rec_name, + numtax=len(line.invoice_taxes))) allowed_cat = ['AE', 'L', 'M', 'E', 'S', 'Z', 'G', 'O', 'K', 'B'] if not line.invoice_taxes[0].tax.unece_category_code in allowed_cat: raise UserError(gettext( 'edocument_xrechnung.msg_linetax_invalid_catcode', - taxname = line.invoice_taxes[0].tax.rec_name, - allowed = ', '.join(allowed_cat), - )) + taxname=line.invoice_taxes[0].tax.rec_name, + allowed=', '.join(allowed_cat))) return line.invoice_taxes[0].tax @@ -84,8 +83,7 @@ class Invoice(Invoice): if len(line.unit.unece_code or '') == 0: raise UserError(gettext( 'edocument_xrechnung.msg_uom_code_missing', - uomname = line.unit.rec_name, - )) + uomname=line.unit.rec_name)) return line.unit.unece_code def tax_category_code(self, tax): @@ -94,8 +92,7 @@ class Invoice(Invoice): if len(tax.unece_category_code or '') == 0: raise UserError(gettext( 'edocument_xrechnung.mds_tax_category_missing', - taxname = tax.rec_name, - )) + taxname=tax.rec_name)) return tax.unece_category_code def quote_text(self, text): @@ -112,7 +109,7 @@ class Invoice(Invoice): os.path.join(os.path.dirname(__file__), 'template'), auto_reload=True) return loader.load(os.path.join(version, 'XRechnung.xml')) - else : + else: return super(Invoice, self)._get_template(version) # end Invoice diff --git a/party.py b/party.py index 38cc321..037bae9 100644 --- a/party.py +++ b/party.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# This file is part of the edcoment-module for Tryton. +# This file is part of the edocument-module for Tryton from m-ds.de. # The COPYRIGHT file at the top level of this repository contains the # full copyright notices and license terms. @@ -19,8 +19,7 @@ class Party(metaclass=PoolMeta): return ident.code raise UserError(gettext( 'edocument_xrechnung.msg_missing_xrechnung_route_id', - partyname = self.rec_name, - )) + partyname=self.rec_name)) # end Party diff --git a/tests/__init__.py b/tests/__init__.py index 173e725..bd1a230 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,23 +1,18 @@ -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. +# -*- coding: utf-8 -*- +# This file is part of the edocument-module for Tryton from m-ds.de. +# 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.edocument_xrechnung.tests.test_edocument import EdocTestCase +from .test_edocument import EdocTestCase __all__ = ['suite'] -class EDocumentTestCase(\ - EdocTestCase,\ - ): - 'Test edocument module' - module = 'edocument_xrechnung' - -# end EDocumentTestCase - def suite(): suite = trytond.tests.test_tryton.suite() - suite.addTests(unittest.TestLoader().loadTestsFromTestCase(EDocumentTestCase)) + suite.addTests(unittest.TestLoader().loadTestsFromTestCase( + EdocTestCase)) return suite