Skip to content

Commit

Permalink
Merge pull request #287 from maykinmedia/feature/251-exand-interne-ta…
Browse files Browse the repository at this point in the history
…ak-admin-to-display-actor

Added InterneTakenActoren to the admin
  • Loading branch information
bart-maykin authored Nov 22, 2024
2 parents be19464 + 8fbef0e commit 240d965
Show file tree
Hide file tree
Showing 3 changed files with 521 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/openklant/components/klantinteracties/admin/actoren.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ class ActorKlantcontactInlineAdmin(admin.StackedInline):
extra = 0


class InterneTaakInlineAdmin(admin.StackedInline):
model = Actor.internetaak_set.through
raw_id_fields = ("internetaak",)
verbose_name = _("Interne taak")
verbose_name_plural = _("Interne taken")
extra = 0


@admin.register(Actor)
class ActorAdmin(admin.ModelAdmin):
list_display = (
Expand All @@ -51,6 +59,7 @@ class ActorAdmin(admin.ModelAdmin):
GeautomatiseerdeActorInlineAdmin,
MedewerkerInlineAdmin,
OrganisatorischeEenheidInlineAdmin,
InterneTaakInlineAdmin,
)
fieldsets = (
(
Expand Down
11 changes: 11 additions & 0 deletions src/openklant/components/klantinteracties/admin/internetaken.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.contrib import admin
from django.utils.translation import gettext_lazy as _

from ..models.internetaken import InterneTaak

Expand All @@ -10,6 +11,14 @@ class InterneTaakInlineAdmin(admin.StackedInline):
readonly_fields = ("uuid",)


class ActorInlineAdmin(admin.StackedInline):
model = InterneTaak.actoren.through
raw_id_fields = ("actor",)
verbose_name = _("Actor")
verbose_name_plural = _("Actoren")
extra = 0


@admin.register(InterneTaak)
class InterneTaakAdmin(admin.ModelAdmin):
readonly_fields = ("uuid",)
Expand All @@ -19,6 +28,7 @@ class InterneTaakAdmin(admin.ModelAdmin):
"toegewezen_op",
"afgehandeld_op",
)
search_fields = ("nummer",)
list_filter = (
"actoren",
"status",
Expand All @@ -27,3 +37,4 @@ class InterneTaakAdmin(admin.ModelAdmin):
"uuid",
"toegewezen_op",
)
inlines = (ActorInlineAdmin,)
Loading

0 comments on commit 240d965

Please sign in to comment.