Search Engine Multi Image Thumbnail
This module is a technical module with the purpose of easing the export of image thumbnails to a search engine index.
It extends the functionality of the connector_search_engine module by adding specialized methods that can be used to get and generate thumbnails from an image you want to index.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Configure thumbnail sizes per search engine backend, model and image field, so that image thumbnails are generated and indexed alongside your records. A new Thumbnails menu lets you manage sizes and see the generated thumbnails.
This module connects your search engine indexes with image thumbnails. For each search engine backend you can define, per model and image field, which thumbnail sizes must be produced. A new "Thumbnails" menu (under the search engine root menu) contains "Thumbnail Sizes", "Index Thumbnail Sizes" and "Indexed Image Thumbnail".
On the backend form a new "Thumbnail Sizes" section lets you add these rules and tick "Fail if no thumbnail size": if ticked, exporting a record whose image field has no size configured raises an error instead of silently skipping it. The same list is shown on the index form.
Thumbnail sizes themselves are records with a name, a key and width/height. When a record is exported to an index, the module looks up the configured sizes for the image field, generates the thumbnails (for single image fields and for multi-image fields) and stores them as indexed thumbnails linked to the original attachment. The attachment form shows the related indexed thumbnails.
A rule prevents creating two identical size rules for the same backend, model and field. Only search engine managers can create or change sizes and rules; other users can read them.
Models and fields (7)
- se.index · extends an existing modelimage_field_thumbnail_size_ids (Thumbnail Sizes)
- se.backend · extends an existing modelfails_if_no_thumbail_size (Fail if no thumbnail size), image_field_thumbnail_size_ids (Thumbnail Sizes)
- se.thumbnail · new model
- ir.attachment · extends an existing modelse_thumbnail_ids (Indexed Thumbnails)
- se.thumbnail.size · new modelkey, name, size_x, size_y
- se.indexable.record · extends an existing model
- se.image.field.thumbnail.size · new modelmodel (Model name), field_id (Images field), model_id (Model), size_ids, backend_id (Search Engine Backend), field_name (Images field name), display_name, field_id_domain (Domain to select images field)
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 2 confirmed, 7 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/search-engine.
terminal Installation and usage
OCA documentation · Odoo 18.0Configuration
Source · Odoo 18.0If you want to force the format of the generated thumbnail, you define a a configuration parameter into Odoo with the key fs_image_thumbnail.resize_format and the value PNG or JPEG or GIF or ICO. Otherwise, the format of the generated thumbnail will be the same as the format of the original image.
Usage
Source · Odoo 18.0As specified, this module will not add any new features by itself once installed. As a developer, you can depend on this module to benefit from a set of specialized methods that can be used to get and generate thumbnails from an image you want to index.
Behind the scenes, this module extend the se.indexable.recor model by adding 2 new methods:
_get_or_create_thumbnails_for_multi_images: This method is used to get or create thumbnails for a set of images._get_or_create_thumbnails_for_image: This method is used to get or create thumbnails for a single image.
Thanks to these methods, you can easily generate thumbnails for images stored into odoo through three different ways:
- A relational field referencing record inheriting from
fs.image.relation.mixin. - An odoo's Image field.
- An FSImage field.
The sizes of the thumbnails generated by these methods are configured through the creation of a new record into the se.thumbnail.size model. This model allows you to define the size of thumbnails by search engine backend, model and field. For example, you can define that you want to generate thumbnails of size 100x100 for all the images stored into the product.template model and the image field when you export them to the opensearch_xyz backend. In this way, you can easily define different thumbnail sizes for different search engine backends, models and fields according to your needs.
Thumbnails are always retrieved and generated for one image and a specific base_name. The base name is used as a key to identify the thumbnails from an image related to a usage and also as base name for the file name of the thumbnails generated. By default, the base_name is computed from the display name of the record that contains the image to ensure a good SEO. To avoid problems with special characters, the base_name is normalized before being used.
Here is an example of how to use these methods:
from odoo import models, fields
from odoo.addons.fs_imeage.fields import FSImage
class ProductImageRelation(models.Model):
_name = "product.image.relation"
_inherit = ["fs.image.relation.mixin"]
name = fields.Char(required=True)
product_id = fields.Many2one(
"product.product",
required=True,
ondelete="cascade",
)
class ProductProduct(models.Model):
_name = "product.product"
_inherit = ["se.indexable.record", "product.product"]
name = fields.Char(required=True)
image = fields.Image(required=True)
image_ids = fields.One2many(
"product.image.relation",
"product_id",
string="Images",
)
fs_image = FSImage(required=True)
# A creation is always done for a given se.index record.
index = self.env["se.index"].browse(1)
product = self.env["product.product"].browse(1)
# Get or create thumbnails for a single image
for (thumbnail_size, thumbnail) in product._get_or_create_thumbnails_for_image(
index,
field_name="image",
):
# Do something with the thumbnail
print(f"Thumbnail for image with size {thumbnail_size.display_name} "
"is available at url {thumbnail.image.url}")
# Get or create thumbnails for a single image
for (thumbnail_size, thumbnail) in product._get_or_create_thumbnails_for_image(
index,
field_name="fs_image",
):
# Do something with the thumbnail
print(f"Thumbnail for fs_image with size {thumbnail_size.display_name} "
"is available at url {thumbnail.image.url}")
# Get or create thumbnails for a set of images
thumbnails_by_image = product._get_or_create_thumbnails_for_multi_images(
index,
field_name="image_ids",
)
for (image, thumbnails) in thumbnails_by_image.items():
for (thumbnail_size, thumbnail) in thumbnails:
# Do something with the thumbnail
print(f"Thumbnail for image {image.name} with size "
"{thumbnail_size.display_name} is available at url "
"{thumbnail.image.url}")No verified information in OCA: Installation.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.