From 51bc8ef124a67ffe710ec69ce450a22a6977ce07 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Thu, 14 May 2020 13:19:58 +0000 Subject: [PATCH] [IMP] doc: Image field documentation It was considered important to precise that image fields without limitations weren't checked at all and could therefore contain non image content (and precise some other things on Image fields). Forward-port of #51200 closes odoo/odoo#51259 Signed-off-by: Victor Feyens (vfe) --- odoo/fields.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/odoo/fields.py b/odoo/fields.py index 23d9a8c4a58..d64555e0025 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -2044,11 +2044,19 @@ class Binary(Field): class Image(Binary): """Encapsulates an image, extending :class:`Binary`. - :param int max_width: the maximum width of the image - :param int max_height: the maximum height of the image + If image size is greater than the ``max_width``/``max_height`` limit of pixels, the image will be + resized to the limit by keeping aspect ratio. + + :param int max_width: the maximum width of the image (default: ``0``, no limit) + :param int max_height: the maximum height of the image (default: ``0``, no limit) :param bool verify_resolution: whether the image resolution should be verified to ensure it doesn't go over the maximum image resolution (default: ``True``). See :class:`odoo.tools.image.ImageProcess` for maximum image resolution (default: ``45e6``). + + .. note:: + + If no ``max_width``/``max_height`` is specified (or is set to 0) and ``verify_resolution`` is False, + the field content won't be verified at all and a :class:`Binary` field should be used. """ max_width = 0 max_height = 0