mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-17 20:55:26 +00:00
Stock location scan (#169)
* Add action for scanning a stock location into another location * Adds barcode scan handler for new functionality * Handle scanning of stock location * Cleanup * Refactor existing barcode scanning functions - Will require extensive testing and validation * Add entry to release notes * Delete dead code * Improved ordering based on stock quantity * Bug fix for 'adjustStock' function * Improve error responses for barcode scanning * Improve error responses for barcode scanning * Remove old debug statements * Add some extra explanatory texts * Icon change * Fixes for unit tests * Adds extra functionality for user profile manager * Refactor barcode code - do not rely on BuildContext * Adds initial unit testing for barcode scanning - Work on mocking barcode data - Add hooks for testing snackBar and audio files * Linting fixes * More barcode unit tests * Cleanup unit tests for barcode * Remove unused import * Handle HTTPException in API * Improvements for API unit testing * Unit testing for scanning item into location * Add unit test for scanning in items from a location context * Unit test for scanning location into parent location * Improve feedback for barcode scanning events
This commit is contained in:
@ -107,6 +107,9 @@ class InvenTreeModel {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Launch a modal form to edit the fields available to this model instance.
|
||||
*/
|
||||
Future<void> editForm(BuildContext context, String title, {Map<String, dynamic> fields=const {}, Function(dynamic)? onSuccess}) async {
|
||||
|
||||
if (fields.isEmpty) {
|
||||
@ -317,7 +320,7 @@ class InvenTreeModel {
|
||||
}
|
||||
|
||||
// POST data to update the model
|
||||
Future<bool> update({Map<String, String> values = const {}}) async {
|
||||
Future<APIResponse> update({Map<String, String> values = const {}, int? expectedStatusCode = 200}) async {
|
||||
|
||||
var url = path.join(URL, pk.toString());
|
||||
|
||||
@ -325,17 +328,13 @@ class InvenTreeModel {
|
||||
url += "/";
|
||||
}
|
||||
|
||||
var response = await api.patch(
|
||||
final response = await api.patch(
|
||||
url,
|
||||
body: values,
|
||||
expectedStatusCode: 200
|
||||
expectedStatusCode: expectedStatusCode,
|
||||
);
|
||||
|
||||
if (!response.isValid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return response;
|
||||
}
|
||||
|
||||
// Return the detail view for the associated pk
|
||||
|
Reference in New Issue
Block a user