mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +00:00
Refactorin'
This commit is contained in:
parent
3e3ab680f6
commit
a4c96694bb
@ -278,10 +278,11 @@ class APIFormField {
|
|||||||
itemAsString: (dynamic item) {
|
itemAsString: (dynamic item) {
|
||||||
switch (model) {
|
switch (model) {
|
||||||
case "part":
|
case "part":
|
||||||
return item["full_name"];
|
return InvenTreePart.fromJson(item).fullname;
|
||||||
case "partcategory":
|
case "partcategory":
|
||||||
|
return InvenTreePartCategory.fromJson(item).pathstring;
|
||||||
case "stocklocation":
|
case "stocklocation":
|
||||||
return item["pathstring"];
|
return InvenTreeStockLocation.fromJson(item).pathstring;
|
||||||
default:
|
default:
|
||||||
return "itemAsString not implemented for '${model}'";
|
return "itemAsString not implemented for '${model}'";
|
||||||
}
|
}
|
||||||
|
@ -107,15 +107,17 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
|
|
||||||
void _editStockItem(BuildContext context) async {
|
void _editStockItem(BuildContext context) async {
|
||||||
|
|
||||||
|
var fields = InvenTreeStockItem().formFields();
|
||||||
|
|
||||||
|
// Some fields we don't want to edit!
|
||||||
|
fields.remove("part");
|
||||||
|
fields.remove("quantity");
|
||||||
|
fields.remove("location");
|
||||||
|
|
||||||
item.editForm(
|
item.editForm(
|
||||||
context,
|
context,
|
||||||
L10().editItem,
|
L10().editItem,
|
||||||
fields: {
|
fields: fields,
|
||||||
"status": {},
|
|
||||||
"batch": {},
|
|
||||||
"packaging": {},
|
|
||||||
"link": {},
|
|
||||||
},
|
|
||||||
onSuccess: (data) async {
|
onSuccess: (data) async {
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user