konfig/buchung eingeben: ausgewählte kassenbücher

This commit is contained in:
Frederik Jaeckel 2022-09-18 12:52:31 +02:00
parent 2acdc55efb
commit 99abc069d8
6 changed files with 282 additions and 7 deletions

View file

@ -134,11 +134,17 @@ class EnterBookingWizard(Wizard):
cfg1 = Configuration.get_singleton()
book_ids = []
for x in ['defbook', 'book1', 'book2', 'book3', 'book4', 'book5']:
if getattr(cfg1, x, None) is not None:
book_ids.append(getattr(cfg1, x, None).id)
result = {
'cashbooks': [x.id for x in Cashbook.search([
('state', '=', 'open'),
('btype', '!=', None),
('owner.id', '=', Transaction().user),
('id', 'in', book_ids),
])],
'bookingtype': getattr(self.start, 'bookingtype', 'out'),
'cashbook': getattr(getattr(cfg1, 'defbook', None), 'id', None),