mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-26 18:37:12 +00:00
28 lines
740 B
Python
28 lines
740 B
Python
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
|
# SPDX-License-Identifier: GPL-3.0-or-lateré
|
|
|
|
from django.contrib import admin
|
|
|
|
from .models import RemittanceType, Remittance
|
|
|
|
|
|
@admin.register(RemittanceType)
|
|
class RemittanceTypeAdmin(admin.ModelAdmin):
|
|
"""
|
|
Admin customisation for RemiitanceType
|
|
"""
|
|
list_display = ('note', )
|
|
|
|
|
|
@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)
|