mirror of https://gitlab.crans.org/bde/nk20
add display field to TransactionTemplate
This commit is contained in:
parent
ea5737ac8f
commit
f3ec0836f8
|
@ -141,8 +141,8 @@ class TransactionTemplateAdmin(admin.ModelAdmin):
|
||||||
"""
|
"""
|
||||||
Admin customisation for TransactionTemplate
|
Admin customisation for TransactionTemplate
|
||||||
"""
|
"""
|
||||||
list_display = ('name', 'poly_destination', 'amount', 'template_type')
|
list_display = ('name', 'poly_destination', 'amount', 'category', 'display', )
|
||||||
list_filter = ('template_type', )
|
list_filter = ('category', 'display')
|
||||||
autocomplete_fields = ('destination', )
|
autocomplete_fields = ('destination', )
|
||||||
|
|
||||||
def poly_destination(self, obj):
|
def poly_destination(self, obj):
|
||||||
|
|
|
@ -54,13 +54,15 @@ class TransactionTemplate(models.Model):
|
||||||
verbose_name=_('amount'),
|
verbose_name=_('amount'),
|
||||||
help_text=_('in centimes'),
|
help_text=_('in centimes'),
|
||||||
)
|
)
|
||||||
template_type = models.ForeignKey(
|
category = models.ForeignKey(
|
||||||
TransactionCategory,
|
TransactionCategory,
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
verbose_name=_('type'),
|
verbose_name=_('type'),
|
||||||
max_length=31,
|
max_length=31,
|
||||||
)
|
)
|
||||||
|
display = models.BooleanField(
|
||||||
|
default = True,
|
||||||
|
)
|
||||||
description = models.CharField(
|
description = models.CharField(
|
||||||
verbose_name=_('description'),
|
verbose_name=_('description'),
|
||||||
max_length=255,
|
max_length=255,
|
||||||
|
|
Loading…
Reference in New Issue