diff --git a/backoffice/backoffice/workflows/admin.py b/backoffice/backoffice/workflows/admin.py index 3aa26827..bc5c3d64 100644 --- a/backoffice/backoffice/workflows/admin.py +++ b/backoffice/backoffice/workflows/admin.py @@ -63,6 +63,21 @@ def has_delete_permission(self, request, obj=None): } +class WorkflowsDecisionsInline(admin.StackedInline): + model = Decision + extra = 0 + can_delete = False + show_change_link = True + readonly_fields = ["action_value", "_updated_at", "user"] + + def has_change_permission(self, request, obj=None): + return False + + @admin.display(description="action") + def action_value(self, obj): + return obj.action + + @admin.register(Workflow) class WorkflowAdmin(BaseModelAdmin): """ @@ -89,6 +104,8 @@ class WorkflowAdmin(BaseModelAdmin): "_updated_at", ] + inlines = [WorkflowsDecisionsInline] + @admin.register(Decision) class DecisionAdmin(BaseModelAdmin):