mirror of
https://github.com/inventree/inventree-app.git
synced 2025-05-04 16:28:54 +00:00
Bug fix - duplicate stock transfer action
This commit is contained in:
parent
27a6025c32
commit
432558678d
@ -484,23 +484,18 @@ class InvenTreeStockItem extends InvenTreeModel {
|
|||||||
quantity = this.quantity;
|
quantity = this.quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> data = {
|
final response = await api.post(
|
||||||
|
"/stock/transfer/",
|
||||||
|
body: {
|
||||||
"item": {
|
"item": {
|
||||||
"pk": "${pk}",
|
"pk": "${pk}",
|
||||||
|
"quantity": "${quantity}",
|
||||||
},
|
},
|
||||||
"location": "${location}",
|
"location": "${location}",
|
||||||
"notes": notes ?? '',
|
"notes": notes ?? "",
|
||||||
};
|
},
|
||||||
|
expectedStatusCode: 200
|
||||||
if (quantity != null) {
|
);
|
||||||
data["item"]["quantity"] = "${quantity}";
|
|
||||||
}
|
|
||||||
|
|
||||||
print("transfer stock!");
|
|
||||||
|
|
||||||
final response = await api.post("/stock/transfer/", body: data);
|
|
||||||
|
|
||||||
print("transfer response: ${response}");
|
|
||||||
|
|
||||||
return response != null;
|
return response != null;
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,6 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
_selectedController.text = selectedLocation.pathstring;
|
_selectedController.text = selectedLocation.pathstring;
|
||||||
},
|
},
|
||||||
onSaved: (value) {
|
onSaved: (value) {
|
||||||
_transferStock(context, selectedLocation);
|
|
||||||
},
|
},
|
||||||
itemBuilder: (context, suggestion) {
|
itemBuilder: (context, suggestion) {
|
||||||
var location = suggestion as InvenTreeStockLocation;
|
var location = suggestion as InvenTreeStockLocation;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user