Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver 2021-06-09 16:16:09 +10:00
commit fae90d19d5
13 changed files with 4249 additions and 4036 deletions

View File

@ -1289,10 +1289,23 @@ class BuildItem(models.Model):
Return qualified URL for part thumbnail image
"""
thumb_url = None
if self.stock_item and self.stock_item.part:
return InvenTree.helpers.getMediaUrl(self.stock_item.part.image.thumbnail.url)
elif self.bom_item and self.stock_item.sub_part:
return InvenTree.helpers.getMediaUrl(self.bom_item.sub_part.image.thumbnail.url)
try:
# Try to extract the thumbnail
thumb_url = self.stock_item.part.image.thumbnail.url
except:
pass
if thumb_url is None and self.bom_item and self.bom_item.sub_part:
try:
thumb_url = self.bom_item.sub_part.image.thumbnail.url
except:
pass
if thumb_url is not None:
return InvenTree.helpers.getMediaUrl(thumb_url)
else:
return InvenTree.helpers.getBlankThumbnail()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -159,7 +159,7 @@ function loadStockTestResultsTable(table, options) {
// Set "parent" for each existing row
tableData.forEach(function(item, idx) {
tableData[idx].parent = options.stock_item;
tableData[idx].parent = parent_node;
});
// Once the test template data are loaded, query for test results

View File

@ -1,7 +1,7 @@
invoke>=1.4.0 # Invoke build tool
wheel>=0.34.2 # Wheel
Django==3.2.1 # Django package
pillow==8.1.1 # Image manipulation
pillow==8.2.0 # Image manipulation
djangorestframework==3.12.4 # DRF framework
django-cors-headers==3.2.0 # CORS headers extension for DRF
django-filter==2.4.0 # Extended filtering options
@ -11,9 +11,8 @@ django-markdownx==3.0.1 # Markdown form fields
django-markdownify==0.8.0 # Markdown rendering
coreapi==2.3.0 # API documentation
pygments==2.7.4 # Syntax highlighting
# tablib==0.13.0 # Import / export data files (installed as dependency of django-import-export package)
django-crispy-forms==1.11.2 # Form helpers
django-import-export==2.0.0 # Data import / export for admin interface
django-import-export==2.5.0 # Data import / export for admin interface
tablib[xls,xlsx,yaml] # Support for XLS and XLSX formats
django-cleanup==5.1.0 # Manage deletion of old / unused uploaded files
flake8==3.8.3 # PEP checking