From 39c0470b2a9a097e686096322daa674a733a33fd Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 27 May 2020 15:54:16 +1000 Subject: [PATCH] Don't display a location tile if the location is null --- lib/inventree/stock.dart | 1 + lib/widget/stock_detail.dart | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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"),