gva/gnuviechadmin/invoices/admin.py

15 lines
305 B
Python
Raw Normal View History

2023-04-23 14:43:44 +02:00
from django.contrib import admin
from invoices.models import Invoice
class InvoiceAdmin(admin.ModelAdmin):
list_display = ["invoice_number", "customer"]
readonly_fields = ["customer"]
def has_add_permission(self, request):
return False
admin.site.register(Invoice, InvoiceAdmin)