mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-18 05:05:28 +00:00
Check if location is set before launching barcode scanner
This commit is contained in:
2
lib/l10n
2
lib/l10n
Submodule lib/l10n updated: 7a23f04bfc...c2348a6559
@ -297,27 +297,29 @@ List<Widget> detailTiles() {
|
|||||||
List<Widget> tiles = [];
|
List<Widget> tiles = [];
|
||||||
|
|
||||||
tiles.add(locationDescriptionCard(includeActions: false));
|
tiles.add(locationDescriptionCard(includeActions: false));
|
||||||
|
|
||||||
// Stock adjustment actions
|
if (location != null) {
|
||||||
if (InvenTreeAPI().checkPermission('stock', 'change')) {
|
// Stock adjustment actions
|
||||||
// Scan items into location
|
if (InvenTreeAPI().checkPermission('stock', 'change')) {
|
||||||
tiles.add(
|
// Scan items into location
|
||||||
ListTile(
|
tiles.add(
|
||||||
title: Text(L10().barcodeScanInItems),
|
ListTile(
|
||||||
leading: FaIcon(FontAwesomeIcons.exchangeAlt),
|
title: Text(L10().barcodeScanInItems),
|
||||||
trailing: FaIcon(FontAwesomeIcons.qrcode),
|
leading: FaIcon(FontAwesomeIcons.exchangeAlt),
|
||||||
onTap: () {
|
trailing: FaIcon(FontAwesomeIcons.qrcode),
|
||||||
Navigator.push(
|
onTap: () {
|
||||||
context,
|
Navigator.push(
|
||||||
MaterialPageRoute(builder: (context) =>
|
context,
|
||||||
InvenTreeQRView(
|
MaterialPageRoute(builder: (context) =>
|
||||||
StockLocationScanInItemsHandler(location)))
|
InvenTreeQRView(
|
||||||
).then((context) {
|
StockLocationScanInItemsHandler(location)))
|
||||||
refresh();
|
).then((context) {
|
||||||
});
|
refresh();
|
||||||
},
|
});
|
||||||
)
|
},
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move location into another location
|
// 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;
|
return tiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user