2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-05-04 08:18:54 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View File

@ -3,6 +3,7 @@
- Fix action button colors
- Added Norwegian translations
- Fix serial number field when creating stock item
### 0.11.5 - April 2023
---

View File

@ -160,7 +160,7 @@ class InvenTreeStockItem extends InvenTreeModel {
"quantity": {},
"serial": {},
"serial_numbers": {
"label": L10().serialNumber,
"label": L10().serialNumbers,
"type": "string",
},
"status": {},

View File

@ -969,6 +969,9 @@
"serialNumber": "Serial Number",
"@serialNumber": {},
"serialNumbers": "Serial Numbers",
"@serialNumbers": {},
"server": "Server",
"@server": {},

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>;