Skip to content

Commit

Permalink
Add to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Mar 20, 2024
1 parent ffbaf8f commit 99a9c60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lemarche/tenders/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ class TenderSiaeInterestedInline(admin.TabularInline):
"detail_contact_click_date",
"survey_transactioned_send_date",
"survey_transactioned_answer",
"transactioned",
]
readonly_fields = [field.name for field in TenderSiae._meta.fields]
readonly_fields = [field.name for field in TenderSiae._meta.fields if field.name not in ["transactioned"]]
extra = 0
show_change_link = True
can_delete = False
Expand Down Expand Up @@ -822,11 +823,12 @@ def queryset(self, request, queryset):

@admin.register(TenderSiae, site=admin_site)
class TenderSiaeAdmin(admin.ModelAdmin):
list_display = ["created_at", "siae_with_app_link", "tender_with_link", "source", "status"]
list_display = ["created_at", "siae_with_app_link", "tender_with_link", "source", "status", "transactioned"]
list_filter = [
("source", TenderSiaeSourceFilter),
TenderSiaeStatusFilter,
"survey_transactioned_answer",
"transactioned",
]

readonly_fields = [field for field in TenderSiae.READONLY_FIELDS] + [
Expand All @@ -843,7 +845,7 @@ class TenderSiaeAdmin(admin.ModelAdmin):
{"fields": ("siae", "siae_with_app_link", "tender_with_link", "source", "found_with_ai")},
),
("Mise en relation", {"fields": (*TenderSiae.FIELDS_RELATION, "status")}),
("Transaction ?", {"fields": TenderSiae.FIELDS_SURVEY_TRANSACTIONED}),
("Transaction ?", {"fields": (*TenderSiae.FIELDS_SURVEY_TRANSACTIONED, "transactioned")}),
("Stats", {"fields": ("logs_display",)}),
("Dates", {"fields": ("created_at", "updated_at")}),
)
Expand Down

0 comments on commit 99a9c60

Please sign in to comment.