formatting, indexes optimized

This commit is contained in:
Frederik Jaeckel 2023-11-29 15:19:38 +01:00
parent 510357a13c
commit 9ee924f0d8
11 changed files with 90 additions and 94 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')