kategorie: sequence-sortierung, rec_name mit/ohne konto-nr,

config: Felder catnamelong+cataccno neu + tests,
line: feld category_view neu für spaltenansicht in kassenbuch + tests,
This commit is contained in:
Frederik Jaeckel 2022-08-10 11:57:35 +02:00
parent a23407f515
commit 1a85b8e80e
15 changed files with 414 additions and 104 deletions

View file

@ -9,6 +9,16 @@ from trytond.pyson import Eval, If
from trytond.pool import Pool
field_checked = fields.Boolean(string='Checked',
help='Show cashbook lines in Checked-state.')
field_done = fields.Boolean(string='Done',
help='Show cashbook lines in Done-state.')
field_catnamelong = fields.Boolean(string='Category: Show long name',
help='Shows the long name of the category in the Category field of a cash book line.')
field_cataccno = fields.Boolean(string='Category: Show account number',
help='Shows the number of the linked account in the name of a category.')
class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
'Configuration'
__name__ = 'cashbook.configuration'
@ -25,8 +35,10 @@ class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
('date_from', '<=', Eval('date_to')),
()),
]))
checked = fields.MultiValue(fields.Boolean(string='Checked'))
done = fields.MultiValue(fields.Boolean(string='Done'))
checked = fields.MultiValue(field_checked)
done = fields.MultiValue(field_done)
catnamelong = fields.MultiValue(field_catnamelong)
cataccno = fields.MultiValue(field_cataccno)
@classmethod
def multivalue_model(cls, field):
@ -34,7 +46,8 @@ class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
"""
pool = Pool()
if field in ['date_from', 'date_to', 'checked', 'done']:
if field in ['date_from', 'date_to', 'checked', 'done',
'catnamelong', 'cataccno']:
return pool.get('cashbook.configuration_user')
return super(Configuration, cls).multivalue_model(field)
@ -46,6 +59,14 @@ class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
def default_done(cls, **pattern):
return cls.multivalue_model('done').default_done()
@classmethod
def default_catnamelong(cls, **pattern):
return cls.multivalue_model('catnamelong').default_catnamelong()
@classmethod
def default_cataccno(cls, **pattern):
return cls.multivalue_model('cataccno').default_cataccno()
# end Configuration
@ -65,13 +86,23 @@ class UserConfiguration(ModelSQL, UserValueMixin):
('date_from', '<=', Eval('date_to')),
()),
])
checked = fields.Boolean(string='Checked')
done = fields.Boolean(string='Done')
checked = field_checked
done = field_done
catnamelong = field_catnamelong
cataccno = field_cataccno
@classmethod
def default_checked(cls):
return True
@classmethod
def default_catnamelong(cls):
return True
@classmethod
def default_cataccno(cls):
return True
@classmethod
def default_done(cls):
return False