diff --git a/InvenTree/order/admin.py b/InvenTree/order/admin.py index 05598928a7..5ad1a6541d 100644 --- a/InvenTree/order/admin.py +++ b/InvenTree/order/admin.py @@ -9,6 +9,7 @@ from import_export.resources import ModelResource from import_export.fields import Field from .models import PurchaseOrder, PurchaseOrderLineItem +from .models import SalesOrder, SalesOrderLineItem class PurchaseOrderAdmin(ImportExportModelAdmin): @@ -22,6 +23,17 @@ class PurchaseOrderAdmin(ImportExportModelAdmin): ) +class SalesOrderAdmin(ImportExportModelAdmin): + + list_display = ( + 'reference', + 'customer', + 'status', + 'description', + 'creation_date', + ) + + class POLineItemResource(ModelResource): """ Class for managing import / export of POLineItem data """ @@ -40,6 +52,16 @@ class POLineItemResource(ModelResource): clean_model_instances = True +class SOLineItemResource(ModelResource): + """ Class for managing import / export of SOLineItem data """ + + class Meta: + model = SalesOrderLineItem + skip_unchanged = True + report_skipped = False + clean_model_instances = True + + class PurchaseOrderLineItemAdmin(ImportExportModelAdmin): resource_class = POLineItemResource @@ -52,5 +74,19 @@ class PurchaseOrderLineItemAdmin(ImportExportModelAdmin): ) +class SalesOrderLineItemAdmin(ImportExportModelAdmin): + + resource_class = SOLineItemResource + + list_display = ( + 'order', + 'quantity', + 'reference' + ) + + admin.site.register(PurchaseOrder, PurchaseOrderAdmin) admin.site.register(PurchaseOrderLineItem, PurchaseOrderLineItemAdmin) + +admin.site.register(SalesOrder, SalesOrderAdmin) +admin.site.register(SalesOrderLineItem, SalesOrderLineItemAdmin)