account in module 'cashbook_account' verschoben

This commit is contained in:
Frederik Jaeckel 2022-08-15 12:35:31 +02:00
parent 149baef174
commit 7a07da852d
18 changed files with 41 additions and 220 deletions

View file

@ -3,7 +3,7 @@
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
from trytond.model import ModelSingleton, ModelView, ModelSQL, Workflow, fields, Check
from trytond.model import ModelSingleton, ModelView, ModelSQL, fields
from .model import UserMultiValueMixin, UserValueMixin
from trytond.pyson import Eval, If
from trytond.pool import Pool
@ -15,8 +15,6 @@ 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):
@ -38,7 +36,6 @@ class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
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):
@ -47,7 +44,7 @@ class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
pool = Pool()
if field in ['date_from', 'date_to', 'checked', 'done',
'catnamelong', 'cataccno']:
'catnamelong']:
return pool.get('cashbook.configuration_user')
return super(Configuration, cls).multivalue_model(field)
@ -63,10 +60,6 @@ class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
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
@ -89,7 +82,6 @@ class UserConfiguration(ModelSQL, UserValueMixin):
checked = field_checked
done = field_done
catnamelong = field_catnamelong
cataccno = field_cataccno
@classmethod
def default_checked(cls):
@ -99,10 +91,6 @@ class UserConfiguration(ModelSQL, UserValueMixin):
def default_catnamelong(cls):
return True
@classmethod
def default_cataccno(cls):
return True
@classmethod
def default_done(cls):
return False