mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 05:26:47 +00:00
Refactorin'
This commit is contained in:
parent
3e3ab680f6
commit
a4c96694bb
@ -278,10 +278,11 @@ class APIFormField {
|
||||
itemAsString: (dynamic item) {
|
||||
switch (model) {
|
||||
case "part":
|
||||
return item["full_name"];
|
||||
return InvenTreePart.fromJson(item).fullname;
|
||||
case "partcategory":
|
||||
return InvenTreePartCategory.fromJson(item).pathstring;
|
||||
case "stocklocation":
|
||||
return item["pathstring"];
|
||||
return InvenTreeStockLocation.fromJson(item).pathstring;
|
||||
default:
|
||||
return "itemAsString not implemented for '${model}'";
|
||||
}
|
||||
|
@ -107,15 +107,17 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
|
||||
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(
|
||||
context,
|
||||
L10().editItem,
|
||||
fields: {
|
||||
"status": {},
|
||||
"batch": {},
|
||||
"packaging": {},
|
||||
"link": {},
|
||||
},
|
||||
fields: fields,
|
||||
onSuccess: (data) async {
|
||||
refresh();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user