Rename thumb to create_thumb method

because product_attachments add new field: thumb
This commit is contained in:
Raimon Esteve 2021-12-20 14:03:16 +01:00
parent 65dcf65f09
commit 801f4e748d
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class Template(metaclass=PoolMeta):
return res return res
@staticmethod @staticmethod
def thumb(data, image_format, crop=THUMB_CROP, def create_thumb(data, image_format, crop=THUMB_CROP,
width=THUMB_WIDTH, height=THUMB_HEIGHT, quality=THUMB_QUALITY): width=THUMB_WIDTH, height=THUMB_HEIGHT, quality=THUMB_QUALITY):
size = (width, height) size = (width, height)
try: try:
@ -93,7 +93,7 @@ class Template(metaclass=PoolMeta):
image_format, = record.image.name.split('.')[-1:] image_format, = record.image.name.split('.')[-1:]
imgformat = (image_format.lower() if image_format.lower() imgformat = (image_format.lower() if image_format.lower()
in {'png', 'jpeg'} else 'jpeg') in {'png', 'jpeg'} else 'jpeg')
res[name][record.id] = cls.thumb(record.image.data, imgformat) res[name][record.id] = cls.create_thumb(record.image.data, imgformat)
return res return res
def get_image_thumb_filename(self, name): def get_image_thumb_filename(self, name):