forked from erp-dev/erp
31 lines
787 B
Python
31 lines
787 B
Python
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
|