Skip to content

Commit 7d32bd6

Browse files
bug fix: PO Lines (#685)
* bug fix: PO Lines - Correctly display part images for purchase order line items * Refactor * Code formatting
1 parent 2870135 commit 7d32bd6

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

assets/release_notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
---
33

44
- Improved UX across the entire app
5+
- Fix bug which prevented display of part images for purchase order line items
56

67
### 0.19.1 - July 2025
78
---

lib/api.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ class InvenTreeFileService extends FileService {
118118

119119
if (_client != null) {
120120
_client!.badCertificateCallback = (cert, host, port) {
121-
print("BAD CERTIFICATE CALLBACK FOR IMAGE REQUEST");
122121
return !strictHttps;
123122
};
124123
}

lib/inventree/model.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,8 @@ class InvenTreeModel {
732732

733733
var response = await api.get(URL, params: params);
734734

735+
print("paginated: ${URL}: ${params}");
736+
735737
if (!response.isValid()) {
736738
return null;
737739
}

lib/inventree/orders.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,15 @@ class InvenTreeOrderLine extends InvenTreeModel {
114114

115115
String get partName => getString("name", subKey: "part_detail");
116116

117-
String get partImage => getString("thumbnail", subKey: "part_detail");
117+
String get partImage {
118+
String img = getString("thumbnail", subKey: "part_detail");
119+
120+
if (img.isEmpty) {
121+
img = getString("image", subKey: "part_detail");
122+
}
123+
124+
return img;
125+
}
118126

119127
String get targetDate => getDateString("target_date");
120128
}

lib/widget/order/po_line_list.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class _PaginatedPOLineListState
6767
final page = await InvenTreePOLineItem().listPaginated(
6868
limit,
6969
offset,
70-
filters: params,
70+
filters: {...params},
7171
);
7272
return page;
7373
}
@@ -85,7 +85,7 @@ class _PaginatedPOLineListState
8585
item.progressString,
8686
color: item.isComplete ? COLOR_SUCCESS : COLOR_WARNING,
8787
),
88-
leading: InvenTreeAPI().getThumbnail(supplierPart.partImage),
88+
leading: InvenTreeAPI().getThumbnail(item.partImage),
8989
onTap: () async {
9090
showLoadingOverlay();
9191
await item.reload();

0 commit comments

Comments
 (0)