mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 04:00:57 +00:00
Part image field now uses django-stdimage
This commit is contained in:
@ -27,6 +27,8 @@ from django_cleanup import cleanup
|
||||
|
||||
from mptt.models import TreeForeignKey
|
||||
|
||||
from stdimage.models import StdImageField
|
||||
|
||||
from decimal import Decimal
|
||||
from datetime import datetime
|
||||
from rapidfuzz import fuzz
|
||||
@ -373,7 +375,13 @@ class Part(models.Model):
|
||||
|
||||
URL = InvenTreeURLField(blank=True, help_text=_('Link to extenal URL'))
|
||||
|
||||
image = models.ImageField(upload_to=rename_part_image, max_length=255, null=True, blank=True)
|
||||
image = StdImageField(
|
||||
upload_to=rename_part_image,
|
||||
null=True,
|
||||
blank=True,
|
||||
variations={'thumbnail': (200, 200)},
|
||||
delete_orphans=True
|
||||
)
|
||||
|
||||
default_location = TreeForeignKey('stock.StockLocation', on_delete=models.SET_NULL,
|
||||
blank=True, null=True,
|
||||
|
Reference in New Issue
Block a user