[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) <vfe@odoo.com>
This commit is contained in:
+10
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user