formatting, indexes optimized

This commit is contained in:
Frederik Jaeckel 2023-11-29 15:19:38 +01:00
parent c87f22674b
commit 01f1aff68f
12 changed files with 124 additions and 120 deletions

View file

@ -28,7 +28,9 @@ class Type(ModelSQL, ModelView):
cls._order.insert(0, ('name', 'ASC'))
t = cls.__table__()
cls._sql_constraints.extend([
('code_uniq', Unique(t, t.short), 'cashbook.msg_type_short_unique'),
('code_uniq',
Unique(t, t.short),
'cashbook.msg_type_short_unique'),
])
@classmethod
@ -48,8 +50,7 @@ class Type(ModelSQL, ModelView):
"""
return '%(short)s - %(name)s' % {
'short': self.short or '-',
'name': self.name or '-',
}
'name': self.name or '-'}
@classmethod
def search_rec_name(cls, name, clause):
@ -58,8 +59,7 @@ class Type(ModelSQL, ModelView):
return [
'OR',
('name',) + tuple(clause[1:]),
('short',) + tuple(clause[1:]),
]
('short',) + tuple(clause[1:])]
@staticmethod
def default_company():