mirror of
https://github.com/inventree/inventree-app.git
synced 2025-11-05 07:45:39 +00:00
Tweaks (#707)
* Remove debug msg * Only request test templates for testable parts * Format
This commit is contained in:
@@ -278,8 +278,6 @@ class InvenTreePart extends InvenTreeModel {
|
|||||||
|
|
||||||
// Request pricing data for this part
|
// Request pricing data for this part
|
||||||
Future<InvenTreePartPricing?> getPricing() async {
|
Future<InvenTreePartPricing?> getPricing() async {
|
||||||
print("REQUEST PRICING FOR: ${pk}");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final response = await InvenTreeAPI().get("/api/part/${pk}/pricing/");
|
final response = await InvenTreeAPI().get("/api/part/${pk}/pricing/");
|
||||||
if (response.isValid()) {
|
if (response.isValid()) {
|
||||||
@@ -411,6 +409,8 @@ class InvenTreePart extends InvenTreeModel {
|
|||||||
|
|
||||||
bool get isTrackable => getBool("trackable");
|
bool get isTrackable => getBool("trackable");
|
||||||
|
|
||||||
|
bool get isTestable => getBool("testable");
|
||||||
|
|
||||||
// Get the IPN (internal part number) for the Part instance
|
// Get the IPN (internal part number) for the Part instance
|
||||||
String get IPN => getString("IPN");
|
String get IPN => getString("IPN");
|
||||||
|
|
||||||
|
|||||||
@@ -190,11 +190,13 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Request part test templates
|
// Request part test templates
|
||||||
part.getTestTemplates().then((value) {
|
if (part.isTestable) {
|
||||||
if (mounted) {
|
part.getTestTemplates().then((value) {
|
||||||
setState(() {});
|
if (mounted) {
|
||||||
}
|
setState(() {});
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Request the number of attachments
|
// Request the number of attachments
|
||||||
InvenTreePartAttachment().countAttachments(part.pk).then((int value) {
|
InvenTreePartAttachment().countAttachments(part.pk).then((int value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user