formatting

This commit is contained in:
Frederik Jaeckel 2024-11-21 14:34:17 +01:00
parent 38295dec35
commit 2dac79debe
4 changed files with 13 additions and 27 deletions

View file

@ -4,7 +4,7 @@
# this repository contains the full copyright notices and license terms.
from trytond.pool import PoolMeta
from trytond.pyson import Eval, And, Or
from trytond.pyson import Eval, And, Or, Bool
class InvoiceLine(metaclass=PoolMeta):
@ -17,10 +17,7 @@ class InvoiceLine(metaclass=PoolMeta):
cls.unit.states['required'],
And(
Eval('type') == 'line',
Eval('quantity', None) != None,
),
)
cls.unit.depends.add('type')
cls.unit.depends.add('quantity')
Bool(Eval('quantity'))))
cls.unit.depends.update(['type', 'quantity'])
# end Invoice

View file

@ -4,14 +4,10 @@
# this repository contains the full copyright notices and license terms.
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
import re
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import ConfigParser
here = path.abspath(path.dirname(__file__))
MODULE = 'account_invoice_xrechnung'
@ -21,7 +17,6 @@ PREFIX = 'mds'
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
# tryton.cfg einlesen
config = ConfigParser()
config.readfp(open('tryton.cfg'))
info = dict(config.items('tryton'))
@ -88,9 +83,9 @@ setup(
'Natural Language :: English',
'Operating System :: OS Independent',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
keywords='tryton account invoice xrechnung edocument',

View file

@ -18,8 +18,7 @@ sel_edocument = [
edoc_versions = {
'edocument.xrechnung.invoice': 'XRechnung-2.2',
'edocument.uncefact.invoice': '16B-CII',
}
'edocument.uncefact.invoice': '16B-CII'}
class RunXRechnungReportStart(ModelView):
@ -62,8 +61,7 @@ class RunXRechnungReport(Wizard):
buttons=[
Button(string='Cancel', state='end', icon='tryton-cancel'),
Button(string='Export', state='export', icon='tryton-export'),
],
)
])
def default_start(self, fields):
""" set defaults
@ -75,8 +73,7 @@ class RunXRechnungReport(Wizard):
result = {
'edocument': 'edocument.xrechnung.invoice',
'invoice': context.get('active_id', -1),
'state': invoice[0].state if len(invoice) > 0 else '',
}
'state': invoice[0].state if invoice else ''}
return result
def do_export(self, action):
@ -85,12 +82,10 @@ class RunXRechnungReport(Wizard):
if self.start.state != 'posted':
raise UserError(gettext(
'account_invoice_xrechnung.msg_invoice_must_posted',
invname=self.start.invoice.rec_name,
))
invname=self.start.invoice.rec_name))
return action, {
'invoice': self.start.invoice.id,
'edocument': self.start.edocument,
'as_zip': self.start.as_zip,
}
'as_zip': self.start.as_zip}
# end RunXRechnungReport

View file

@ -39,8 +39,7 @@ class XReport(Report):
file_name = slugify('%(date)s-%(descr)s' % {
'date': IrDate.today().isoformat().replace('-', ''),
'descr': invoice.rec_name,
},
'descr': invoice.rec_name},
max_length=100, word_boundary=True, save_order=True)
if data['as_zip'] is True: