From 772c88170eef6f358385016ad689582a1985f96e Mon Sep 17 00:00:00 2001 From: Enmanuel Sancho Quintanilla Date: Wed, 21 Jan 2026 15:37:42 -0600 Subject: [PATCH] Improve Sales Order UX: Stock Location, Customer Filtering & Enhanced List View (#756) * feat(sales-order): Improve UX with location display, customer filtering, and enhanced list - Show stock location when selecting items to allocate in sales orders - Filter inactive customers from customer selection dropdown - Display customer name and order total in sales order list view These changes improve the day-to-day usability for warehouse and field staff by providing more context in key workflows without requiring extra navigation. * Format code --- lib/api_form.dart | 1 + lib/inventree/sales_order.dart | 2 +- lib/widget/order/sales_order_list.dart | 9 ++++++++- lib/widget/order/so_allocation_list.dart | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/api_form.dart b/lib/api_form.dart index 7201b7d6..9df134cc 100644 --- a/lib/api_form.dart +++ b/lib/api_form.dart @@ -732,6 +732,7 @@ class APIFormField { return ListTile( title: Text(item.partName), + subtitle: Text(item.locationPathString), leading: InvenTreeAPI().getThumbnail(item.partThumbnail), trailing: Text(item.quantityString()), ); diff --git a/lib/inventree/sales_order.dart b/lib/inventree/sales_order.dart index 77c3469d..82cc0748 100644 --- a/lib/inventree/sales_order.dart +++ b/lib/inventree/sales_order.dart @@ -48,7 +48,7 @@ class InvenTreeSalesOrder extends InvenTreeOrder { Map> fields = { "reference": {}, "customer": { - "filters": {"is_customer": true}, + "filters": {"is_customer": true, "active": true}, }, "customer_reference": {}, "description": {}, diff --git a/lib/widget/order/sales_order_list.dart b/lib/widget/order/sales_order_list.dart index 0a8bfb04..e05bcf5a 100644 --- a/lib/widget/order/sales_order_list.dart +++ b/lib/widget/order/sales_order_list.dart @@ -151,9 +151,16 @@ class _PaginatedSalesOrderListState InvenTreeCompany? customer = order.customer; + // Build subtitle with customer name and optional total price + String subtitle = customer?.name ?? order.description; + if (order.totalPrice != null && order.totalPrice! > 0) { + subtitle += + " • ${order.totalPriceCurrency} ${order.totalPrice!.toStringAsFixed(2)}"; + } + return ListTile( title: Text(order.reference), - subtitle: Text(order.description), + subtitle: Text(subtitle), leading: customer == null ? null : InvenTreeAPI().getThumbnail(customer.thumbnail), diff --git a/lib/widget/order/so_allocation_list.dart b/lib/widget/order/so_allocation_list.dart index 5076f071..88699d03 100644 --- a/lib/widget/order/so_allocation_list.dart +++ b/lib/widget/order/so_allocation_list.dart @@ -55,10 +55,11 @@ class _PaginatedSOAllocationListState InvenTreePart? part = allocation.part; InvenTreeStockItem? stockItem = allocation.stockItem; + InvenTreeStockLocation? location = allocation.location; return ListTile( title: Text(part?.fullname ?? ""), - subtitle: Text(part?.description ?? ""), + subtitle: Text(location?.pathstring ?? L10().locationNotSet), onTap: () async { stockItem?.goToDetailPage(context); },