nk20/apps/treasury/admin.py

28 lines
740 B
Python
Raw Normal View History

2020-03-21 15:49:18 +00:00
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
2020-03-24 16:06:50 +00:00
# SPDX-License-Identifier: GPL-3.0-or-lateré
2020-03-21 15:49:18 +00:00
from django.contrib import admin
2020-03-24 16:06:50 +00:00
from .models import RemittanceType, Remittance
2020-03-21 15:49:18 +00:00
2020-03-24 16:06:50 +00:00
@admin.register(RemittanceType)
class RemittanceTypeAdmin(admin.ModelAdmin):
"""
Admin customisation for RemiitanceType
"""
list_display = ('note', )
2020-03-21 15:49:18 +00:00
2020-03-24 16:06:50 +00:00
@admin.register(Remittance)
class RemittanceAdmin(admin.ModelAdmin):
"""
Admin customisation for Remittance
"""
list_display = ('remittance_type', 'date', 'comment', 'count', 'amount', 'closed', )
def has_change_permission(self, request, obj=None):
if not obj:
return True
return not obj.closed and super().has_change_permission(request, obj)