mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-14 19:25:27 +00:00
Modern attachments (#505)
* Minimum API version is now 100 * Remove old API features - Anything below API v100 no longer supported * Reefactor attachment widget to support modern attachment API * Filter and display attachments correctly * Refactor
This commit is contained in:
@ -140,15 +140,13 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
}
|
||||
|
||||
// Assign or un-assign barcodes
|
||||
if (api.supportModernBarcodes) {
|
||||
actions.add(
|
||||
customBarcodeAction(
|
||||
context, this,
|
||||
location!.customBarcode, "stocklocation",
|
||||
location!.pk
|
||||
)
|
||||
);
|
||||
}
|
||||
actions.add(
|
||||
customBarcodeAction(
|
||||
context, this,
|
||||
location!.customBarcode, "stocklocation",
|
||||
location!.pk
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return actions;
|
||||
|
@ -183,15 +183,13 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
)
|
||||
);
|
||||
|
||||
if (api.supportModernBarcodes) {
|
||||
actions.add(
|
||||
customBarcodeAction(
|
||||
context, this,
|
||||
widget.item.customBarcode,
|
||||
"stockitem", widget.item.pk
|
||||
)
|
||||
);
|
||||
}
|
||||
actions.add(
|
||||
customBarcodeAction(
|
||||
context, this,
|
||||
widget.item.customBarcode,
|
||||
"stockitem", widget.item.pk
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return actions;
|
||||
@ -246,12 +244,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
}
|
||||
|
||||
// Request the number of attachments
|
||||
InvenTreeStockItemAttachment().count(
|
||||
filters: {
|
||||
"stock_item": widget.item.pk.toString()
|
||||
}
|
||||
).then((int value) {
|
||||
|
||||
InvenTreeStockItemAttachment().countAttachments(widget.item.pk).then((int value) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
attachmentCount = value;
|
||||
|
Reference in New Issue
Block a user