mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 05:26:47 +00:00
Supplier part fix (#408)
* Change supplier part fields based on API version * Display packaging info on supplier part page * Icon consolidation * Bump version number
This commit is contained in:
parent
d6460d58aa
commit
d2a01a0286
@ -1,3 +1,8 @@
|
|||||||
|
### 0.12.7 - July 2023
|
||||||
|
---
|
||||||
|
|
||||||
|
- Bug fix for Supplier Part editing page
|
||||||
|
|
||||||
### 0.12.6 - July 2023
|
### 0.12.6 - July 2023
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ class APIFormField {
|
|||||||
default:
|
default:
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
"Unsupported field type: '${type}'",
|
"Unsupported field type: '${type}' for field '${name}'",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: COLOR_DANGER,
|
color: COLOR_DANGER,
|
||||||
fontStyle: FontStyle.italic),
|
fontStyle: FontStyle.italic),
|
||||||
|
@ -122,14 +122,22 @@ class InvenTreeSupplierPart extends InvenTreeModel {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Map<String, dynamic> formFields() {
|
Map<String, dynamic> formFields() {
|
||||||
return {
|
Map<String, dynamic> fields = {
|
||||||
"supplier": {},
|
"supplier": {},
|
||||||
"SKU": {},
|
"SKU": {},
|
||||||
"link": {},
|
"link": {},
|
||||||
"note": {},
|
"note": {},
|
||||||
"packaging": {},
|
"packaging": {},
|
||||||
"pack_size": {},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// At some point, pack_size was changed to pack_quantity
|
||||||
|
if (InvenTreeAPI().apiVersion < 117) {
|
||||||
|
fields["pack_size"] = {};
|
||||||
|
} else {
|
||||||
|
fields["pack_quantity"] = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> _filters() {
|
Map<String, String> _filters() {
|
||||||
@ -178,6 +186,16 @@ class InvenTreeSupplierPart extends InvenTreeModel {
|
|||||||
|
|
||||||
String get note => getString("note");
|
String get note => getString("note");
|
||||||
|
|
||||||
|
String get packaging => getString("packaging");
|
||||||
|
|
||||||
|
String get pack_quantity {
|
||||||
|
if (InvenTreeAPI().apiVersion < 117) {
|
||||||
|
return getString("pack_size");
|
||||||
|
} else {
|
||||||
|
return getString("pack_quantity");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreeSupplierPart.fromJson(json);
|
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreeSupplierPart.fromJson(json);
|
||||||
}
|
}
|
||||||
|
@ -636,7 +636,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
ListTile(
|
ListTile(
|
||||||
title: Text(L10().packaging),
|
title: Text(L10().packaging),
|
||||||
subtitle: Text(widget.item.packaging),
|
subtitle: Text(widget.item.packaging),
|
||||||
leading: FaIcon(FontAwesomeIcons.box),
|
leading: FaIcon(FontAwesomeIcons.boxesPacking),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -192,6 +192,18 @@ class _SupplierPartDisplayState extends RefreshableState<SupplierPartDetailWidge
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Packaging
|
||||||
|
if (widget.supplierPart.packaging.isNotEmpty || widget.supplierPart.pack_quantity.isNotEmpty) {
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(L10().packaging),
|
||||||
|
subtitle: widget.supplierPart.packaging.isNotEmpty ? Text(widget.supplierPart.packaging) : null,
|
||||||
|
leading: FaIcon(FontAwesomeIcons.boxesPacking),
|
||||||
|
trailing: widget.supplierPart.pack_quantity.isNotEmpty ? Text(widget.supplierPart.pack_quantity) : null,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (widget.supplierPart.link.isNotEmpty) {
|
if (widget.supplierPart.link.isNotEmpty) {
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: inventree
|
name: inventree
|
||||||
description: InvenTree stock management
|
description: InvenTree stock management
|
||||||
|
|
||||||
version: 0.12.6+73
|
version: 0.12.7+74
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.5 <3.0.0"
|
sdk: ">=2.19.5 <3.0.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user