mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-13 10:45:29 +00:00
Use 'available_stock' when available (new API)
This commit is contained in:
@ -218,10 +218,10 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
// Stock information
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().stock),
|
||||
title: Text(L10().availableStock),
|
||||
subtitle: Text(L10().stockDetails),
|
||||
leading: FaIcon(FontAwesomeIcons.boxes, color: COLOR_CLICK),
|
||||
trailing: Text("${part.inStockString}"),
|
||||
trailing: Text(part.availableStockString),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
tabIndex = 1;
|
||||
@ -230,48 +230,9 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
),
|
||||
);
|
||||
|
||||
// Keywords?
|
||||
if (part.keywords.isNotEmpty) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("${part.keywords}"),
|
||||
leading: FaIcon(FontAwesomeIcons.key),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// External link?
|
||||
if (part.link.isNotEmpty) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("${part.link}"),
|
||||
leading: FaIcon(FontAwesomeIcons.link, color: COLOR_CLICK),
|
||||
onTap: () {
|
||||
part.openLink();
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Tiles for "purchaseable" parts
|
||||
if (part.isPurchaseable) {
|
||||
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().suppliers),
|
||||
leading: FaIcon(FontAwesomeIcons.industry),
|
||||
trailing: Text("${part.supplierCount}"),
|
||||
/* TODO:
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => PartSupplierWidget(part))
|
||||
);
|
||||
},
|
||||
*/
|
||||
)
|
||||
);
|
||||
|
||||
// On order
|
||||
tiles.add(
|
||||
ListTile(
|
||||
@ -317,6 +278,29 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
}
|
||||
}
|
||||
|
||||
// Keywords?
|
||||
if (part.keywords.isNotEmpty) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("${part.keywords}"),
|
||||
leading: FaIcon(FontAwesomeIcons.key),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// External link?
|
||||
if (part.link.isNotEmpty) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("${part.link}"),
|
||||
leading: FaIcon(FontAwesomeIcons.link, color: COLOR_CLICK),
|
||||
onTap: () {
|
||||
part.openLink();
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Tiles for "component" part
|
||||
if (part.isComponent && part.usedInCount > 0) {
|
||||
|
||||
@ -333,6 +317,25 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
if (part.isPurchaseable) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().suppliers),
|
||||
leading: FaIcon(FontAwesomeIcons.industry),
|
||||
trailing: Text("${part.supplierCount}"),
|
||||
/* TODO:
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => PartSupplierWidget(part))
|
||||
);
|
||||
},
|
||||
*/
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// TODO - Add request tests?
|
||||
/*
|
||||
if (part.isTrackable) {
|
||||
|
Reference in New Issue
Block a user