mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Bug fix and refactoring
- Display difference between "in stock" and "unallocated stock" - Refactor to use single function in detail and list widgets
This commit is contained in:
parent
8d255885cf
commit
84edaef10a
3 changed files with 31 additions and 16 deletions
|
|
@ -204,24 +204,24 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||
);
|
||||
} else {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().partCategory),
|
||||
subtitle: Text(L10().partCategoryTopLevel),
|
||||
leading: FaIcon(FontAwesomeIcons.sitemap, color: COLOR_CLICK),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => CategoryDisplayWidget(null)));
|
||||
},
|
||||
)
|
||||
ListTile(
|
||||
title: Text(L10().partCategory),
|
||||
subtitle: Text(L10().partCategoryTopLevel),
|
||||
leading: FaIcon(FontAwesomeIcons.sitemap, color: COLOR_CLICK),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(
|
||||
builder: (context) => CategoryDisplayWidget(null)));
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Stock information
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().availableStock),
|
||||
subtitle: Text(L10().stockDetails),
|
||||
leading: FaIcon(FontAwesomeIcons.boxes, color: COLOR_CLICK),
|
||||
trailing: Text(part.availableStockString),
|
||||
trailing: Text(part.stockString()),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
tabIndex = 1;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class _PaginatedPartListState extends PaginatedSearchState<PaginatedPartList> {
|
|||
return ListTile(
|
||||
title: Text(part.fullname),
|
||||
subtitle: Text(part.description),
|
||||
trailing: Text(part.availableStockString),
|
||||
trailing: Text(part.stockString()),
|
||||
leading: InvenTreeAPI().getImage(
|
||||
part.thumbnail,
|
||||
width: 40,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue