formatting, indexes optimized

This commit is contained in:
Frederik Jaeckel 2023-11-29 15:19:38 +01:00
parent 77ee7d15b7
commit 7220cff5ac
12 changed files with 124 additions and 126 deletions

View file

@ -50,7 +50,7 @@ class EnterBookingStart(ModelView):
string='Category',
model_name='cashbook.category', depends=['bookingtype'],
states={
'readonly': Bool(Eval('bookingtype')) == False,
'readonly': ~Bool(Eval('bookingtype')),
'required': Eval('bookingtype', '').in_(['in', 'out']),
'invisible': ~Eval('bookingtype', '').in_(['in', 'out']),
},
@ -90,7 +90,8 @@ class EnterBookingStart(ModelView):
if self.bookingtype:
if self.category:
if self.bookingtype not in types.get(self.category.cattype, ''):
if self.bookingtype not in types.get(
self.category.cattype, ''):
self.category = None
@fields.depends('cashbook', '_parent_cashbook.owner')