mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 10:15:32 +00:00
Check if location is set before launching barcode scanner
This commit is contained in:
@ -297,27 +297,29 @@ List<Widget> detailTiles() {
|
||||
List<Widget> 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<Widget> detailTiles() {
|
||||
);
|
||||
*/
|
||||
|
||||
if (tiles.length <= 1) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10().actionsNone,
|
||||
style: TextStyle(
|
||||
fontStyle: FontStyle.italic
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return tiles;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user