Config: setting for booking-wizard - 'fixate'

This commit is contained in:
Frederik Jaeckel 2024-06-01 11:13:47 +02:00
parent 865a2c7fa6
commit 400ebed692
7 changed files with 62 additions and 3 deletions

View file

@ -71,6 +71,8 @@ class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
help='Cash book available in selection dialog.',
model_name='cashbook.book', ondelete='SET NULL',
domain=[('btype', '!=', None), ('state', '=', 'open')]))
fixate = fields.MultiValue(fields.Boolean(
string='Fixate', help='Fixating of the booking is activated.'))
@classmethod
def multivalue_model(cls, field):
@ -81,7 +83,7 @@ class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
if field in [
'date_from', 'date_to', 'checked', 'done',
'catnamelong', 'defbook', 'book1', 'book2',
'book3', 'book4', 'book5']:
'book3', 'book4', 'book5', 'fixate']:
return pool.get('cashbook.configuration_user')
return super(Configuration, cls).multivalue_model(field)
@ -97,6 +99,10 @@ class Configuration(ModelSingleton, ModelSQL, ModelView, UserMultiValueMixin):
def default_catnamelong(cls, **pattern):
return cls.multivalue_model('catnamelong').default_catnamelong()
@classmethod
def default_fixate(cls, **pattern):
return cls.multivalue_model('fixate').default_fixate()
# end Configuration
@ -175,6 +181,9 @@ class UserConfiguration(ModelSQL, UserValueMixin):
('owner.id', '=', Eval('iduser', -1))
], depends=['iduser'])
fixate = fields.Boolean(
string='Fixate', help='Fixating of the booking is activated.')
@classmethod
def default_checked(cls):
return True
@ -187,4 +196,8 @@ class UserConfiguration(ModelSQL, UserValueMixin):
def default_done(cls):
return False
@classmethod
def default_fixate(cls):
return False
# end UserConfiguration