summaryrefslogtreecommitdiff
path: root/odoo/fields.py
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2020-05-14 13:19:58 +0000
committerVictor Feyens <vfe@odoo.com>2020-05-14 13:19:58 +0000
commit51bc8ef124a67ffe710ec69ce450a22a6977ce07 (patch)
treeae46f9c00f8bcfeb541f56a63609000d0ca449dc /odoo/fields.py
parent8d99fd9448c53746a17d2be1b81e76a0539a9534 (diff)
[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>
Diffstat (limited to 'odoo/fields.py')
-rw-r--r--odoo/fields.py12
1 files 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