Compare commits

..

No commits in common. "6aeae91c80d1d00c0e366babb2741c0559bd953f" and "809d9a3235b0f3895cb4015a767b9636eee95835" have entirely different histories.

20 changed files with 52 additions and 263 deletions

View file

@ -27,7 +27,7 @@ Download and install from the [Apple App Store](https://apps.apple.com/au/app/in
### Direct Download (Android) ### Direct Download (Android)
We provide direct downloads for Android users - view our [download page via polar.sh](https://buy.polar.sh/polar_cl_UnGILJ0c7P3hQrOrJs127oyLTTDOTHKrnqfCg30XtBI) We provide direct downloads for Android users - view our [download page via polar.sh](https://polar.sh/inventree/products/299bf0d5-af88-4e0f-becf-c007ad37ecf2)
## User Documentation ## User Documentation

View file

@ -30,8 +30,7 @@ if (keystorePropertiesFile.exists()) {
android { android {
namespace "inventree.inventree_app" namespace "inventree.inventree_app"
ndkVersion "26.3.11579264" compileSdkVersion 35
compileSdkVersion 36
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_17 sourceCompatibility JavaVersion.VERSION_17
@ -57,7 +56,7 @@ android {
defaultConfig { defaultConfig {
applicationId "inventree.inventree_app" applicationId "inventree.inventree_app"
minSdkVersion 23 minSdkVersion 21
targetSdkVersion 35 targetSdkVersion 35
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName

View file

@ -19,7 +19,7 @@ pluginManagement {
plugins { plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.6.0" apply false id "com.android.application" version "8.6.0" apply false
id "org.jetbrains.kotlin.android" version "2.3.10" apply false id "org.jetbrains.kotlin.android" version "1.9.25" apply false
} }
include ":app" include ":app"

View file

@ -1,39 +1,3 @@
## 0.22.7 - March 2026
---
- Bug fix for loading sales order shipments
## 0.22.6 - March 2026
---
- Fix for displaying stock item test results
## 0.22.5 - March 2026
---
- Fix default value for "cascade" filter in PartCategory list view
- Fix default value for "cascade" filter in StockLocation list view
## 0.22.4 - March 2026
---
- Adds button to check server connection
- Fixes bug fetching sales order shipments
- Fix for boolean fields in API forms
## 0.22.3 - February 2026
---
- Auto-fill location data when receiving item via barcode scan
- Visual improvements for boolean form fields
- Add support for tri-state boolean form fields
- Bug fixes for refreshing list view data
## 0.22.2 - February 2026
---
- Bug fix for label printing, which used improperly formatted URL
## 0.22.1 - February 2026 ## 0.22.1 - February 2026
--- ---

6
flake.lock generated
View file

@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1774386573, "lastModified": 1769170682,
"narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", "narHash": "sha256-oMmN1lVQU0F0W2k6OI3bgdzp2YOHWYUAw79qzDSjenU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", "rev": "c5296fdd05cfa2c187990dd909864da9658df755",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -33,17 +33,15 @@
androidSdk = androidSdk =
(pkgs.androidenv.composeAndroidPackages { (pkgs.androidenv.composeAndroidPackages {
platformVersions = [ platformVersions = [
"36"
"35" "35"
"34" "34"
]; ];
buildToolsVersions = [ buildToolsVersions = [
"36.0.0"
"35.0.0" "35.0.0"
"34.0.0" "34.0.0"
]; ];
includeNDK = true; includeNDK = true;
ndkVersions = [ "26.3.11579264" ]; ndkVersions = [ "26.1.10909125" ];
cmakeVersions = [ "3.22.1" ]; cmakeVersions = [ "3.22.1" ];
}).androidsdk; }).androidsdk;

1
ios/.gitignore vendored
View file

@ -22,7 +22,6 @@ Flutter/Generated.xcconfig
Flutter/ephemeral/ Flutter/ephemeral/
Flutter/app.flx Flutter/app.flx
Flutter/app.zip Flutter/app.zip
Flutter/ephemeral/
Flutter/flutter_assets/ Flutter/flutter_assets/
Flutter/flutter_export_environment.sh Flutter/flutter_export_environment.sh
ServiceDefinitions.json ServiceDefinitions.json

View file

@ -411,7 +411,7 @@ class InvenTreeAPI {
* 5. Request information on available plugins * 5. Request information on available plugins
*/ */
Future<bool> _connectToServer() async { Future<bool> _connectToServer() async {
if (!await checkServer()) { if (!await _checkServer()) {
return false; return false;
} }
@ -451,8 +451,8 @@ class InvenTreeAPI {
* Check that the remote server is available. * Check that the remote server is available.
* Ping the api/ endpoint, which does not require user authentication * Ping the api/ endpoint, which does not require user authentication
*/ */
Future<bool> checkServer({String? server}) async { Future<bool> _checkServer() async {
String address = server ?? profile?.server ?? ""; String address = profile?.server ?? "";
if (address.isEmpty) { if (address.isEmpty) {
showSnackIcon( showSnackIcon(
@ -463,10 +463,8 @@ class InvenTreeAPI {
return false; return false;
} }
String url = _makeUrl("/api/", base: address); if (!address.endsWith("/")) {
address = address + "/";
if (!url.endsWith("/")) {
url = url + "/";
} }
// Cache the "strictHttps" setting, so we can use it later without async requirement // Cache the "strictHttps" setting, so we can use it later without async requirement
@ -476,7 +474,7 @@ class InvenTreeAPI {
debug("Connecting to ${apiUrl}"); debug("Connecting to ${apiUrl}");
APIResponse response = await get(url, expectedStatusCode: 200); APIResponse response = await get("", expectedStatusCode: 200);
if (!response.successful()) { if (!response.successful()) {
debug("Server returned invalid response: ${response.statusCode}"); debug("Server returned invalid response: ${response.statusCode}");

View file

@ -275,7 +275,7 @@ class APIFormField {
return; return;
} }
String url = api_url + value.toString() + "/"; String url = api_url + "/" + value.toString() + "/";
final APIResponse response = await InvenTreeAPI().get(url, params: filters); final APIResponse response = await InvenTreeAPI().get(url, params: filters);
@ -293,8 +293,6 @@ class APIFormField {
return _constructString(); return _constructString();
case "boolean": case "boolean":
return _constructBoolean(); return _constructBoolean();
case "boolean filter":
return _constructBooleanFilter();
case "related field": case "related field":
return _constructRelatedField(); return _constructRelatedField();
case "integer": case "integer":
@ -876,109 +874,25 @@ class APIFormField {
// Construct a boolean input element // Construct a boolean input element
Widget _constructBoolean() { Widget _constructBoolean() {
bool v = false; bool? initial_value;
if (value is bool) { if (value is bool || value == null) {
v = value as bool; initial_value = value as bool?;
} else { } else {
v = false; String vs = value.toString().toLowerCase();
initial_value = ["1", "true", "yes"].contains(vs);
} }
return ListTile( return CheckBoxField(
title: Text(label), label: label,
subtitle: Text(helpText), labelStyle: _labelStyle(),
contentPadding: EdgeInsets.zero, helperText: helpText,
trailing: Switch( helperStyle: _helperStyle(),
value: v, initial: initial_value,
onChanged: (val) { tristate: (getParameter("tristate") ?? false) as bool,
onSaved: (val) {
setFieldValue(val); setFieldValue(val);
}, },
),
);
}
// Construct a tri-state boolean filter element
Widget _constructBooleanFilter() {
String initial_value = "null";
bool allow_null = (getParameter("tristate") ?? false) as bool;
if (value is bool) {
initial_value = value.toString().toLowerCase();
} else if (value == null) {
if (allow_null) {
initial_value = "null";
} else {
initial_value = "false";
}
} else {
// Not a boolean value - may be a string
if (["1", "true", "yes"].contains(value.toString().toLowerCase())) {
initial_value = "true";
} else if ([
"0",
"false",
"no",
].contains(value.toString().toLowerCase())) {
initial_value = "false";
} else if (allow_null) {
initial_value = "null";
} else {
initial_value = "false";
}
}
List<ButtonSegment<String>> buttons = [];
if ((getParameter("tristate") ?? false) as bool) {
buttons.add(
ButtonSegment<String>(
value: "null",
icon: Icon(TablerIcons.minus, color: COLOR_GRAY_LIGHT),
),
);
}
buttons.add(
ButtonSegment<String>(
value: "false",
icon: Icon(TablerIcons.x, color: COLOR_DANGER),
),
);
buttons.add(
ButtonSegment<String>(
value: "true",
icon: Icon(TablerIcons.check, color: COLOR_SUCCESS),
),
);
return ListTile(
title: Text(label),
subtitle: Text(helpText),
contentPadding: EdgeInsets.zero,
trailing: SegmentedButton<String>(
segments: buttons,
selected: {initial_value},
showSelectedIcon: false,
multiSelectionEnabled: false,
style: SegmentedButton.styleFrom(
padding: EdgeInsets.all(0),
// minimumSize: MaterialStateProperty.all(Size(0, 0)),
// tapTargetSize: MaterialTapTargetSize.shrinkWrap,
visualDensity: VisualDensity.compact,
),
onSelectionChanged: (Set<String> selection) {
String element = selection.first;
if (element == "null" && allow_null) {
setFieldValue(null);
} else if (element == "true") {
setFieldValue(true);
} else {
setFieldValue(false);
}
},
),
); );
} }
@ -1254,9 +1168,7 @@ class APIFormWidgetState extends State<APIFormWidget> {
// Callback for when a field value is changed // Callback for when a field value is changed
// Default implementation does nothing, // Default implementation does nothing,
// but custom form implementations may override this function // but custom form implementations may override this function
void onValueChanged(String field, dynamic value) { void onValueChanged(String field, dynamic value) {}
setState(() {});
}
Future<void> handleSuccess( Future<void> handleSuccess(
Map<String, dynamic> submittedData, Map<String, dynamic> submittedData,
@ -1482,7 +1394,7 @@ class APIFormWidgetState extends State<APIFormWidget> {
if (field.isSimple) { if (field.isSimple) {
// Simple top-level field data // Simple top-level field data
data[field.name] = field.data["value"] ?? field.defaultValue; data[field.name] = field.data["value"];
} else { } else {
// Not so simple... (WHY DID I MAKE THE API SO COMPLEX?) // Not so simple... (WHY DID I MAKE THE API SO COMPLEX?)
if (field.parent.isNotEmpty) { if (field.parent.isNotEmpty) {

View file

@ -154,12 +154,9 @@ class POAllocateBarcodeHandler extends BarcodeHandler {
return onBarcodeUnknown(data); return onBarcodeUnknown(data);
} }
// Extract field data from the returned result
dynamic supplier_part = data["supplierpart"]; dynamic supplier_part = data["supplierpart"];
dynamic location = data["location"];
int supplier_part_pk = -1; int supplier_part_pk = -1;
int location_pk = -1;
if (supplier_part is Map<String, dynamic>) { if (supplier_part is Map<String, dynamic>) {
supplier_part_pk = (supplier_part["pk"] ?? -1) as int; supplier_part_pk = (supplier_part["pk"] ?? -1) as int;
@ -167,10 +164,6 @@ class POAllocateBarcodeHandler extends BarcodeHandler {
return onBarcodeUnknown(data); return onBarcodeUnknown(data);
} }
if (location is Map<String, dynamic>) {
location_pk = (location["pk"] ?? -1) as int;
}
// Dispose of the barcode scanner // Dispose of the barcode scanner
if (OneContext.hasContext) { if (OneContext.hasContext) {
OneContext().pop(); OneContext().pop();
@ -184,10 +177,6 @@ class POAllocateBarcodeHandler extends BarcodeHandler {
fields["part"]?["hidden"] = false; fields["part"]?["hidden"] = false;
fields["part"]?["value"] = supplier_part_pk; fields["part"]?["value"] = supplier_part_pk;
if (location_pk > 0) {
fields["location"]?["value"] = location_pk;
}
InvenTreePOLineItem().createForm( InvenTreePOLineItem().createForm(
context, context,
L10().lineItemAdd, L10().lineItemAdd,

View file

@ -270,9 +270,9 @@ class InvenTreeSalesOrderShipment extends InvenTreeModel {
InvenTreeSalesOrderShipment.fromJson(json); InvenTreeSalesOrderShipment.fromJson(json);
@override @override
String get URL => "order/so/shipment/"; String get URL => "/order/so/shipment/";
String get SHIP_SHIPMENT_URL => "order/so/shipment/${pk}/ship/"; String get SHIP_SHIPMENT_URL => "/order/so/shipment/${pk}/ship/";
@override @override
Future<Object?> goToDetailPage(BuildContext context) async { Future<Object?> goToDetailPage(BuildContext context) async {
@ -345,7 +345,7 @@ class InvenTreeSalesOrderAllocation extends InvenTreeModel {
InvenTreeSalesOrderAllocation.fromJson(json); InvenTreeSalesOrderAllocation.fromJson(json);
@override @override
String get URL => "order/so-allocation/"; String get URL => "/order/so-allocation/";
@override @override
List<String> get rolesRequired => ["sales_order"]; List<String> get rolesRequired => ["sales_order"];

View file

@ -294,9 +294,6 @@
"confirmScanDetail": "Confirm stock transfer details when scanning barcodes", "confirmScanDetail": "Confirm stock transfer details when scanning barcodes",
"@confirmScanDetail": {}, "@confirmScanDetail": {},
"connectionCheck": "Check Connection",
"@connectionCheck": {},
"connectionRefused": "Connection Refused", "connectionRefused": "Connection Refused",
"@connectionRefused": {}, "@connectionRefused": {},

View file

@ -7,7 +7,7 @@ import "package:inventree/l10.dart";
import "package:inventree/widget/progress.dart"; import "package:inventree/widget/progress.dart";
import "package:inventree/widget/snacks.dart"; import "package:inventree/widget/snacks.dart";
const String PRINT_LABEL_URL = "label/print/"; const String PRINT_LABEL_URL = "api/label/print/";
/* /*
* Custom form handler for label printing. * Custom form handler for label printing.
@ -45,8 +45,6 @@ class LabelFormWidgetState extends APIFormWidgetState {
if (field == "plugin") { if (field == "plugin") {
onPluginChanged(value.toString()); onPluginChanged(value.toString());
} }
super.onValueChanged(field, value);
} }
@override @override

View file

@ -298,9 +298,6 @@ class _ProfileEditState extends State<ProfileEditWidget> {
String name = ""; String name = "";
String server = ""; String server = "";
bool? serverStatus;
bool serverChecking = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -414,49 +411,6 @@ class _ProfileEditState extends State<ProfileEditWidget> {
return null; return null;
}, },
), ),
Divider(),
SizedBox(
width: double.infinity,
child: ElevatedButton.icon(
label: Text(L10().connectionCheck),
icon: serverStatus == true
? Icon(TablerIcons.circle_check, color: COLOR_SUCCESS)
: serverStatus == false
? Icon(TablerIcons.circle_x, color: COLOR_DANGER)
: Icon(TablerIcons.question_mark, color: COLOR_WARNING),
onPressed: serverChecking
? null
: () async {
if (serverChecking) {
return;
}
if (!formKey.currentState!.validate()) {
return;
}
if (mounted) {
setState(() {
serverStatus = null;
serverChecking = true;
});
}
formKey.currentState!.save();
InvenTreeAPI().checkServer(server: server).then((
result,
) {
if (mounted) {
setState(() {
serverStatus = result;
serverChecking = false;
});
}
});
},
),
),
], ],
), ),
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),

View file

@ -92,10 +92,9 @@ abstract class PaginatedSearchState<T extends PaginatedSearchWidget>
// Skip null values // Skip null values
if (value == null) { if (value == null) {
f[k] = "null"; continue;
} else {
f[k] = value.toString();
} }
f[k] = value.toString();
} }
return f; return f;
@ -207,7 +206,7 @@ abstract class PaginatedSearchState<T extends PaginatedSearchWidget>
} }
Map<String, dynamic> filter = { Map<String, dynamic> filter = {
"type": "boolean filter", "type": "boolean",
"display_name": label, "display_name": label,
"label": label, "label": label,
"help_text": help_text, "help_text": help_text,
@ -342,16 +341,7 @@ abstract class PaginatedSearchState<T extends PaginatedSearchWidget>
Map<String, String> f = await constructFilters(); Map<String, String> f = await constructFilters();
if (f.isNotEmpty) { if (f.isNotEmpty) {
for (String k in f.keys) { params.addAll(f);
// Remove any existing filter keys
dynamic value = f[k];
if (value == null || value == "null") {
params.remove(k);
} else {
params[k] = value.toString();
}
}
} }
final page = await requestPage(_pageSize, pageKey, params); final page = await requestPage(_pageSize, pageKey, params);

View file

@ -54,7 +54,7 @@ class _PaginatedPartCategoryListState
@override @override
Map<String, Map<String, dynamic>> get filterOptions => { Map<String, Map<String, dynamic>> get filterOptions => {
"cascade": { "cascade": {
"default": true, "default": false,
"label": L10().includeSubcategories, "label": L10().includeSubcategories,
"help_text": L10().includeSubcategoriesDetail, "help_text": L10().includeSubcategoriesDetail,
"tristate": false, "tristate": false,

View file

@ -66,7 +66,6 @@ class _PaginatedStockLocationListState
"label": L10().includeSublocations, "label": L10().includeSublocations,
"help_text": L10().includeSublocationsDetail, "help_text": L10().includeSublocationsDetail,
"tristate": false, "tristate": false,
"default": true,
}, },
}; };

View file

@ -225,7 +225,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
// Request part information // Request part information
part = await InvenTreePart().get(widget.item.partId) as InvenTreePart?; part = await InvenTreePart().get(widget.item.partId) as InvenTreePart?;
stockShowTests &= part?.isTestable ?? false; stockShowTests &= part?.isTrackable ?? false;
// Request default location // Request default location
int? defaultLocationId = part?.defaultLocation; int? defaultLocationId = part?.defaultLocation;

View file

@ -637,14 +637,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
jni:
dependency: transitive
description:
name: jni
sha256: d2c361082d554d4593c3012e26f6b188f902acd291330f13d6427641a92b3da1
url: "https://pub.dev"
source: hosted
version: "0.14.2"
js: js:
dependency: transitive dependency: transitive
description: description:
@ -745,10 +737,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: mobile_scanner name: mobile_scanner
sha256: c92c26bf2231695b6d3477c8dcf435f51e28f87b1745966b1fe4c47a286171ce sha256: "54005bdea7052d792d35b4fef0f84ec5ddc3a844b250ecd48dc192fb9b4ebc95"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.2.0" version: "7.0.1"
node_preamble: node_preamble:
dependency: transitive dependency: transitive
description: description:
@ -929,18 +921,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: sentry name: sentry
sha256: "605ad1f6f1ae5b72018cbe8fc20f490fa3bd53e58882e5579566776030d8c8c1" sha256: "599701ca0693a74da361bc780b0752e1abc98226cf5095f6b069648116c896bb"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.14.0" version: "8.14.2"
sentry_flutter: sentry_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
name: sentry_flutter name: sentry_flutter
sha256: "7fd0fb80050c1f6a77ae185bda997a76d384326d6777cf5137a6c38952c4ac7d" sha256: "5ba2cf40646a77d113b37a07bd69f61bb3ec8a73cbabe5537b05a7c89d2656f8"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.14.0" version: "8.14.2"
shared_preferences: shared_preferences:
dependency: transitive dependency: transitive
description: description:

View file

@ -1,7 +1,7 @@
name: inventree name: inventree
description: InvenTree stock management description: InvenTree stock management
version: 0.22.7+116 version: 0.22.1+110
environment: environment:
sdk: ^3.8.1 sdk: ^3.8.1
@ -28,19 +28,19 @@ dependencies:
flutter_markdown: ^0.6.19 # Rendering markdown flutter_markdown: ^0.6.19 # Rendering markdown
flutter_overlay_loader: ^2.0.0 # Overlay screen support flutter_overlay_loader: ^2.0.0 # Overlay screen support
flutter_speed_dial: ^6.2.0 # Speed dial / FAB implementation flutter_speed_dial: ^6.2.0 # Speed dial / FAB implementation
flutter_tabler_icons: ^1.43.0 # Tabler icons flutter_tabler_icons: ^1.43.0
http: ^1.4.0 http: ^1.4.0
image_picker: ^1.1.2 # Select or take photos image_picker: ^1.1.2 # Select or take photos
infinite_scroll_pagination: ^4.0.0 # Let the server do all the work! infinite_scroll_pagination: ^4.0.0 # Let the server do all the work!
intl: ^0.20.2 intl: ^0.20.2
mobile_scanner: ^7.2.0 # Barcode scanning support mobile_scanner: ^7.0.1 # Barcode scanning support
one_context: ^4.0.0 # Dialogs without requiring context one_context: ^4.0.0 # Dialogs without requiring context
open_filex: ^4.7.0 # Open local files open_filex: ^4.7.0 # Open local files
package_info_plus: ^8.1.1 # App information introspection package_info_plus: ^8.1.1 # App information introspection
path: ^1.9.0 path: ^1.9.0
path_provider: ^2.1.5 # Local file storage path_provider: ^2.1.5 # Local file storage
sembast: ^3.6.0 # NoSQL data storage sembast: ^3.6.0 # NoSQL data storage
sentry_flutter: ^9.14.0 # Error reporting sentry_flutter: 8.14.2 # Error reporting
url_launcher: ^6.3.1 # Open link in system browser url_launcher: ^6.3.1 # Open link in system browser
wakelock_plus: ^1.3.2 # Prevent device from sleeping wakelock_plus: ^1.3.2 # Prevent device from sleeping