book: neues Feld 'description', sperrt btype-->None mit Zeilen + Test

line: verwendet nur kassenbücher mit typ
This commit is contained in:
Frederik Jaeckel 2022-09-16 10:15:51 +02:00
parent a2e7f192f8
commit 2acdc55efb
12 changed files with 107 additions and 11 deletions

View file

@ -931,6 +931,7 @@ class LineContext(ModelView):
cashbook = fields.Many2One(string='Cashbook', required=True,
model_name='cashbook.book',
domain=[('btype', '!=', None)],
states={
'readonly': Eval('num_cashbook', 0) < 2,
}, depends=['num_cashbook'])
@ -993,7 +994,7 @@ class LineContext(ModelView):
with Transaction().set_context({
'_check_access': True,
}):
return CashBook.search_count([])
return CashBook.search_count([('btype', '!=', None)])
@classmethod
def default_done(cls):