2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-15 11:45:31 +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:
Oliver
2024-06-11 23:16:01 +10:00
committed by GitHub
parent c3eb1a5fca
commit e837394495
18 changed files with 151 additions and 167 deletions

View File

@ -90,15 +90,13 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
List<SpeedDialChild> actions = [];
if (InvenTreePart().canEdit) {
if (api.supportModernBarcodes) {
actions.add(
customBarcodeAction(
context, this,
widget.part.customBarcode, "part",
widget.part.pk
)
);
}
actions.add(
customBarcodeAction(
context, this,
widget.part.customBarcode, "part",
widget.part.pk
)
);
}
return actions;
@ -184,18 +182,10 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
});
// Request the number of parameters for this part
if (api.supportsPartParameters) {
showParameters = await InvenTreeSettingsManager().getValue(INV_PART_SHOW_PARAMETERS, true) as bool;
} else {
showParameters = false;
}
showParameters = await InvenTreeSettingsManager().getValue(INV_PART_SHOW_PARAMETERS, true) as bool;
// Request the number of attachments
InvenTreePartAttachment().count(
filters: {
"part": part.pk.toString(),
}
).then((int value) {
InvenTreePartAttachment().countAttachments(part.pk).then((int value) {
if (mounted) {
setState(() {
attachmentCount = value;