diff --git a/lib/inventree/stock.dart b/lib/inventree/stock.dart index f3c05996..2b137cd0 100644 --- a/lib/inventree/stock.dart +++ b/lib/inventree/stock.dart @@ -267,6 +267,7 @@ class InvenTreeStockItem extends InvenTreeModel { loc = jsondata['location_detail']['name'] ?? ''; } + // Old-style name if (loc.isEmpty) { loc = jsondata['location__name'] ?? ''; } diff --git a/lib/widget/stock_detail.dart b/lib/widget/stock_detail.dart index 54fb5399..71198bb4 100644 --- a/lib/widget/stock_detail.dart +++ b/lib/widget/stock_detail.dart @@ -380,7 +380,7 @@ class _StockItemDisplayState extends RefreshableState { } // Location information - if (item.locationName.isNotEmpty) { + if ((item.locationId > 0) && (item.locationName != null) && (item.locationName.isNotEmpty)) { tiles.add( ListTile( title: Text("Stock Location"),