fixed error in history admin when company was none
This commit is contained in:
@@ -11,13 +11,10 @@ def model_admin_callable(co):
|
|||||||
|
|
||||||
class ProductAdmin(admin.ModelAdmin):
|
class ProductAdmin(admin.ModelAdmin):
|
||||||
form = forms.ProductTagForm
|
form = forms.ProductTagForm
|
||||||
list_display = ('name', 'category', 'sourcing_date', 'company_name', 'active' )
|
list_display = ('name', 'category', 'sourcing_date', 'company', 'active' )
|
||||||
list_filter = ('company', 'tags', 'category', 'attributes')
|
list_filter = ('company', 'tags', 'category', 'attributes')
|
||||||
search_fields = ('name', 'sku', 'description')
|
search_fields = ('name', 'sku', 'description')
|
||||||
|
|
||||||
def company_name(self, product):
|
|
||||||
return product.company.company_name
|
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(models.Product, ProductAdmin)
|
admin.site.register(models.Product, ProductAdmin)
|
||||||
admin.site.register(models.TreeTag)
|
admin.site.register(models.TreeTag)
|
||||||
|
|||||||
Reference in New Issue
Block a user