diff --git a/lib/l10n b/lib/l10n index 7a23f04b..c2348a65 160000 --- a/lib/l10n +++ b/lib/l10n @@ -1 +1 @@ -Subproject commit 7a23f04bfc11dd099511536bdb8b72a9b35edecf +Subproject commit c2348a65593f92e8fa4c2dc643baf8fdafd48ca4 diff --git a/lib/widget/location_display.dart b/lib/widget/location_display.dart index a295e3cb..e6e75a12 100644 --- a/lib/widget/location_display.dart +++ b/lib/widget/location_display.dart @@ -297,27 +297,29 @@ List detailTiles() { List tiles = []; tiles.add(locationDescriptionCard(includeActions: false)); - - // Stock adjustment actions - if (InvenTreeAPI().checkPermission('stock', 'change')) { - // Scan items into location - tiles.add( - ListTile( - title: Text(L10().barcodeScanInItems), - leading: FaIcon(FontAwesomeIcons.exchangeAlt), - trailing: FaIcon(FontAwesomeIcons.qrcode), - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => - InvenTreeQRView( - StockLocationScanInItemsHandler(location))) - ).then((context) { - refresh(); - }); - }, - ) - ); + + if (location != null) { + // Stock adjustment actions + if (InvenTreeAPI().checkPermission('stock', 'change')) { + // Scan items into location + tiles.add( + ListTile( + title: Text(L10().barcodeScanInItems), + leading: FaIcon(FontAwesomeIcons.exchangeAlt), + trailing: FaIcon(FontAwesomeIcons.qrcode), + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => + InvenTreeQRView( + StockLocationScanInItemsHandler(location))) + ).then((context) { + refresh(); + }); + }, + ) + ); + } } // Move location into another location @@ -332,6 +334,19 @@ List detailTiles() { ); */ + if (tiles.length <= 1) { + tiles.add( + ListTile( + title: Text( + L10().actionsNone, + style: TextStyle( + fontStyle: FontStyle.italic + ), + ) + ) + ); + } + return tiles; }