forked from erp-dev/erp
init
This commit is contained in:
30
stock/admin.py
Normal file
30
stock/admin.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from django.contrib import admin
|
||||
from . import models
|
||||
|
||||
|
||||
@admin.register(models.PurchaseOrder)
|
||||
class PurchaseOrderAdmin(admin.ModelAdmin):
|
||||
list_display = ('id', 'supplier', 'order_date', 'total_amount')
|
||||
search_fields = ('supplier__name',)
|
||||
list_filter = ('order_date',)
|
||||
ordering = ('-order_date',)
|
||||
|
||||
|
||||
@admin.register(models.Inventory)
|
||||
class InventoryAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
'id',
|
||||
'product',
|
||||
'product_color',
|
||||
'warehouse',
|
||||
'quantity',
|
||||
'num_of_rolls',
|
||||
'minimum_quantity',
|
||||
'updated_at',
|
||||
)
|
||||
search_fields = ('product__name', 'warehouse__name')
|
||||
list_filter = ('warehouse',)
|
||||
|
||||
@admin.display(description='颜色')
|
||||
def product_color(self, obj):
|
||||
return obj.product.color
|
||||
Reference in New Issue
Block a user