mirror of
https://github.com/inventree/inventree-app.git
synced 2026-09-09 03:10:14 +00:00
On stock transfer - added merge stock option (already on web UI) (#875)
* added merge stock transfer option * update release notes and version
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
## 0.25.2 - August 2026
|
|
||||||
|
## 0.25.3 - September 2026
|
||||||
---
|
---
|
||||||
|
|
||||||
- Bug fix for part location display
|
- On stock transfer, add a merge option.
|
||||||
- Bug fix for stock location display
|
- For merge option, check default value from server.
|
||||||
- Updated translations
|
|
||||||
|
|
||||||
## 0.25.1 - August 2026
|
## 0.25.1 - August 2026
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class StockItemScanIntoLocationHandler extends BarcodeScanStockLocationHandler {
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
Map<String, dynamic> fields = item.transferFields();
|
Map<String, dynamic> fields = await item.transferFields();
|
||||||
|
|
||||||
// Override location with scanned value
|
// Override location with scanned value
|
||||||
fields["location"]?["value"] = locationId;
|
fields["location"]?["value"] = locationId;
|
||||||
@@ -243,7 +243,7 @@ class StockLocationScanInItemsHandler extends BarcodeScanStockItemHandler {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
Map<String, dynamic> fields = item.transferFields();
|
Map<String, dynamic> fields = await item.transferFields();
|
||||||
|
|
||||||
// Override location with provided location value
|
// Override location with provided location value
|
||||||
fields["location"]?["value"] = location.pk;
|
fields["location"]?["value"] = location.pk;
|
||||||
|
|||||||
@@ -146,13 +146,26 @@ class InvenTreeStockItem extends InvenTreeModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return a set of fields to transfer this stock item via dialog
|
// Return a set of fields to transfer this stock item via dialog
|
||||||
Map<String, dynamic> transferFields() {
|
Future<Map<String, dynamic>> transferFields() async {
|
||||||
|
// Read the server-side global default for merge-on-transfer
|
||||||
|
final bool mergeDefault = await InvenTreeAPI().getGlobalBooleanSetting(
|
||||||
|
"STOCK_MERGE_ON_TRANSFER",
|
||||||
|
);
|
||||||
|
|
||||||
Map<String, dynamic> fields = {
|
Map<String, dynamic> fields = {
|
||||||
"pk": {"parent": "items", "nested": true, "hidden": true, "value": pk},
|
"pk": {"parent": "items", "nested": true, "hidden": true, "value": pk},
|
||||||
"quantity": {"parent": "items", "nested": true, "value": quantity},
|
"quantity": {"parent": "items", "nested": true, "value": quantity},
|
||||||
"location": {"value": locationId},
|
"location": {"value": locationId},
|
||||||
"status": {"parent": "items", "nested": true, "value": status},
|
"status": {"parent": "items", "nested": true, "value": status},
|
||||||
"packaging": {"parent": "items", "nested": true, "value": packaging},
|
"packaging": {"parent": "items", "nested": true, "value": packaging},
|
||||||
|
"merge": {
|
||||||
|
"parent": "items",
|
||||||
|
"nested": true,
|
||||||
|
"type": "boolean",
|
||||||
|
"label": L10().mergeStockOnTransfer,
|
||||||
|
"help_text": L10().mergeStockOnTransferDetail,
|
||||||
|
"value": mergeDefault,
|
||||||
|
},
|
||||||
"notes": {},
|
"notes": {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1882,6 +1882,12 @@
|
|||||||
"transferStockLocationDetail": "Transfer this stock location into another",
|
"transferStockLocationDetail": "Transfer this stock location into another",
|
||||||
"@transferStockLocationDetail": {},
|
"@transferStockLocationDetail": {},
|
||||||
|
|
||||||
|
"mergeStockOnTransfer": "Merge stock on transfer",
|
||||||
|
"@mergeStockOnTransfer": {},
|
||||||
|
|
||||||
|
"mergeStockOnTransferDetail": "Merge transferred stock into existing stock at destination if possible",
|
||||||
|
"@mergeStockOnTransferDetail": {},
|
||||||
|
|
||||||
"translate": "Translate",
|
"translate": "Translate",
|
||||||
"@translate": {},
|
"@translate": {},
|
||||||
|
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
* Launches an API Form to transfer this stock item to a new location
|
* Launches an API Form to transfer this stock item to a new location
|
||||||
*/
|
*/
|
||||||
Future<void> _transferStockDialog(BuildContext context) async {
|
Future<void> _transferStockDialog(BuildContext context) async {
|
||||||
Map<String, dynamic> fields = widget.item.transferFields();
|
Map<String, dynamic> fields = await widget.item.transferFields();
|
||||||
|
|
||||||
launchApiForm(
|
launchApiForm(
|
||||||
context,
|
context,
|
||||||
|
|||||||
+12
-20
@@ -189,10 +189,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
version: "1.4.1"
|
||||||
checked_yaml:
|
checked_yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -693,14 +693,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.14.2"
|
version: "0.14.2"
|
||||||
js:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: js
|
|
||||||
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.2"
|
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -761,18 +753,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.17"
|
version: "0.12.19"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.11.1"
|
version: "0.13.0"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1222,26 +1214,26 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: test
|
name: test
|
||||||
sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7"
|
sha256: "280d6d890011ca966ad08df7e8a4ddfab0fb3aa49f96ed6de56e3521347a9ae7"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.26.3"
|
version: "1.30.0"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
|
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.7"
|
version: "0.7.10"
|
||||||
test_core:
|
test_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_core
|
name: test_core
|
||||||
sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0"
|
sha256: "0381bd1585d1a924763c308100f2138205252fb90c9d4eeaf28489ee65ccde51"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.12"
|
version: "0.6.16"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
name: inventree
|
name: inventree
|
||||||
description: InvenTree stock management
|
description: InvenTree stock management
|
||||||
|
|
||||||
version: 0.25.2+125
|
version: 0.25.3+126
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.8.1
|
sdk: ^3.8.1
|
||||||
|
|||||||
Reference in New Issue
Block a user