2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 03:25:42 +00:00

Create thumbnails for Company model

This commit is contained in:
Oliver Walters
2020-04-07 11:17:00 +10:00
parent 16d3a87e78
commit 1a233e7949
2 changed files with 29 additions and 1 deletions

View File

@ -21,6 +21,8 @@ from django.conf import settings
from markdownx.models import MarkdownxField
from stdimage.models import StdImageField
from InvenTree.fields import InvenTreeURLField, RoundingDecimalField
from InvenTree.status_codes import OrderStatus
from common.models import Currency
@ -90,7 +92,13 @@ class Company(models.Model):
link = InvenTreeURLField(blank=True, help_text=_('Link to external company information'))
image = models.ImageField(upload_to=rename_company_image, max_length=255, null=True, blank=True)
image = StdImageField(
upload_to=rename_company_image,
null=True,
blank=True,
variations={'thumnbnail': (128, 128)},
delete_orphans=True,
)
notes = MarkdownxField(blank=True)