Initial commit: Django inventory system
This commit is contained in:
19
myproject/inventory/admin.py
Normal file
19
myproject/inventory/admin.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from django.contrib import admin
|
||||
from .models import Stock, StockMovement
|
||||
|
||||
|
||||
class StockAdmin(admin.ModelAdmin):
|
||||
list_display = ('product', 'quantity_available', 'quantity_reserved', 'updated_at')
|
||||
list_filter = ('updated_at',)
|
||||
search_fields = ('product__name', 'product__sku')
|
||||
|
||||
|
||||
class StockMovementAdmin(admin.ModelAdmin):
|
||||
list_display = ('product', 'change', 'reason', 'order', 'created_at')
|
||||
list_filter = ('reason', 'created_at')
|
||||
search_fields = ('product__name', 'order__id')
|
||||
date_hierarchy = 'created_at'
|
||||
|
||||
|
||||
admin.site.register(Stock, StockAdmin)
|
||||
admin.site.register(StockMovement, StockMovementAdmin)
|
||||
Reference in New Issue
Block a user