2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Bug fix for stock item creation form

This commit is contained in:
Oliver 2022-01-05 14:58:04 +11:00
parent dcc7ee4eae
commit 25701c0c1c
4 changed files with 16 additions and 3 deletions

View File

@ -1,6 +1,11 @@
## InvenTree App Release Notes ## InvenTree App Release Notes
--- ---
### 0.5.5 - January 2022
---
- Fixes bug in stock item creation form
### 0.5.4 - January 2022 ### 0.5.4 - January 2022
--- ---

View File

@ -873,8 +873,15 @@ Future<void> launchApiForm(
} }
// Add instance value to the field // Add instance value to the field
field.data["instance_value"] = modelData[fieldName]; dynamic model_value = modelData[fieldName];
if (model_value != null) {
field.data["instance_value"] = model_value;
if (field.data["value"] == null) {
field.data["value"] = model_value;
}
}
formFields.add(field); formFields.add(field);
} }

View File

@ -59,7 +59,8 @@ class _PaginatedPartListState extends PaginatedSearchState<PaginatedPartList> {
@override @override
Future<InvenTreePageResponse?> requestPage(int limit, int offset, Map<String, String> params) async { Future<InvenTreePageResponse?> requestPage(int limit, int offset, Map<String, String> params) async {
final bool cascade = await InvenTreeSettingsManager().getBool("partSubcategory", true);
final bool cascade = await InvenTreeSettingsManager().getBool(INV_PART_SUBCATEGORY, true);
params["cascade"] = "${cascade}"; params["cascade"] = "${cascade}";

View File

@ -57,7 +57,7 @@ class _PaginatedStockItemListState extends PaginatedSearchState<PaginatedStockIt
Future<InvenTreePageResponse?> requestPage(int limit, int offset, Map<String, String> params) async { Future<InvenTreePageResponse?> requestPage(int limit, int offset, Map<String, String> params) async {
// Do we include stock items from sub-locations? // Do we include stock items from sub-locations?
final bool cascade = await InvenTreeSettingsManager().getBool("stockSublocation", true); final bool cascade = await InvenTreeSettingsManager().getBool(INV_STOCK_SUBLOCATION, true);
params["cascade"] = "${cascade}"; params["cascade"] = "${cascade}";