mirror of
https://github.com/ae-utbm/sith.git
synced 2026-11-20 07:59:50 +00:00
Proposition V1
This commit is contained in:
1 parent
bfa5fa45b8
commit
fc961f6511
36 files changed
+1984
No files matched your search
@@ -0,0 +1,46 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from stock.models import Stock, StockAction, StockItem, StockItemAction, StockItemStock
|
||||
|
||||
|
||||
@admin.register(Stock)
|
||||
class StockAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "club", "can_be_view_by_board", "created_at", "updated_at")
|
||||
search_fields = ("name",)
|
||||
autocomplete_fields = ("club",)
|
||||
|
||||
|
||||
@admin.register(StockAction)
|
||||
class StockActionAdmin(admin.ModelAdmin):
|
||||
list_display = ("action", "comment", "user", "created_at")
|
||||
search_fields = ("action",)
|
||||
autocomplete_fields = ("user",)
|
||||
|
||||
|
||||
@admin.register(StockItem)
|
||||
class StockItemAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
"name",
|
||||
"description",
|
||||
"is_hidden",
|
||||
"is_allow_negative",
|
||||
"created_at",
|
||||
)
|
||||
search_fields = ("name",)
|
||||
|
||||
|
||||
@admin.register(StockItemStock)
|
||||
class StockItemStockAdmin(admin.ModelAdmin):
|
||||
list_display = ("stock", "item", "quantity")
|
||||
autocomplete_fields = ("stock", "item")
|
||||
|
||||
|
||||
@admin.register(StockItemAction)
|
||||
class StockItemActionAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
"action",
|
||||
"item",
|
||||
"quantity_before",
|
||||
"quantity_after",
|
||||
)
|
||||
search_fields = ("item",)
|
||||
Reference in new issue
Block a user