2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 18:25:26 +00:00

Fix duplicate serial number field (#334)

This commit is contained in:
Oliver
2023-04-20 20:47:40 +10:00
committed by GitHub
parent 1d6708fbca
commit 232f721712
4 changed files with 14 additions and 1 deletions

View File

@ -239,6 +239,9 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
);
}
/*
* Launch a dialog form to create a new stock item
*/
Future<void> _newStockItem(BuildContext context) async {
int pk = location?.pk ?? -1;
@ -246,12 +249,18 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
return;
}
var fields = InvenTreeStockItem().formFields();
// Serial number field is not required here
fields.remove("serial");
InvenTreeStockItem().createForm(
context,
L10().stockItemCreate,
data: {
"location": location != null ? pk : null,
},
fields: fields,
onSuccess: (result) async {
Map<String, dynamic> data = result as Map<String, dynamic>;