You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
860 B
Python

8 months ago
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class ImageMixin(models.AbstractModel):
_name = 'image.mixin'
_description = "Image Mixin"
# all image fields are base64 encoded and PIL-supported
image_1920 = fields.Image("Image", max_width=1920, max_height=1920)
# resized fields stored (as attachment) for performance
image_1024 = fields.Image("Image 1024", related="image_1920", max_width=1024, max_height=1024, store=True)
image_512 = fields.Image("Image 512", related="image_1920", max_width=512, max_height=512, store=True)
image_256 = fields.Image("Image 256", related="image_1920", max_width=256, max_height=256, store=True)
image_128 = fields.Image("Image 128", related="image_1920", max_width=128, max_height=128, store=True)