mirror of
https://github.com/inventree/inventree-app.git
synced 2026-06-10 08:27:15 +00:00
Support "creation_date" field for StockItem (#823)
Ref: https://github.com/inventree/InvenTree/pull/12011
This commit is contained in:
@@ -732,6 +732,17 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
if (api.supportsStockItemCreationDate &&
|
||||
widget.item.creationDateString.isNotEmpty) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().creationDate),
|
||||
trailing: LargeText(widget.item.creationDateString),
|
||||
leading: Icon(TablerIcons.calendar_plus),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Last update?
|
||||
if (widget.item.updatedDateString.isNotEmpty) {
|
||||
tiles.add(
|
||||
|
||||
@@ -50,15 +50,24 @@ class _PaginatedStockItemListState
|
||||
String get prefix => "stock_";
|
||||
|
||||
@override
|
||||
Map<String, String> get orderingOptions => {
|
||||
"part__name": L10().name,
|
||||
"part__IPN": L10().internalPartNumber,
|
||||
"stock": L10().quantity,
|
||||
"status": L10().status,
|
||||
"batch": L10().batchCode,
|
||||
"updated": L10().lastUpdated,
|
||||
"stocktake_date": L10().lastStocktake,
|
||||
};
|
||||
Map<String, String> get orderingOptions {
|
||||
Map<String, String> options = {
|
||||
"part__name": L10().name,
|
||||
"part__IPN": L10().internalPartNumber,
|
||||
"stock": L10().quantity,
|
||||
"status": L10().status,
|
||||
"batch": L10().batchCode,
|
||||
"creation_date": L10().creationDate,
|
||||
"updated": L10().lastUpdated,
|
||||
"stocktake_date": L10().lastStocktake,
|
||||
};
|
||||
|
||||
if (!InvenTreeAPI().supportsStockItemCreationDate) {
|
||||
options.remove("creation_date");
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Map<String, dynamic>> get filterOptions {
|
||||
|
||||
Reference in New Issue
Block a user