Repository
OCA/storage · module folder · Try on Runboat
Module version
1.0.0
Category
Uncategorized
Folder size
0.08 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/storage
Last tracking update
2026-08-07 08:42:56
Authors
ACSONE SA/NV, Odoo Community Association (OCA)
Maintainers
ACSONE SA/NV, Odoo Community Association (OCA)
Committers
Sébastien BEAU, OCA-git-bot, oca-ci
Odoo dependencies
OCA/server-env:
OCA/server-tools:
OCA/storage:
odoo/odoo:
- web
Python dependencies
python_slugify, fsspec>=2025.3.0, fsspec>=2024.5.0
System dependencies
None
Required by
search_engine_image_thumbnail
Description
This module extends the **fs_image** addon to support the creation and
the storage of thumbnails for images. This module is a **technical
module** and is not meant to be installed by end-users. It only provides
a mixin to be used by other modules and a model to store the thumbnails.

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
fs_image_thumbnail_mixin_form_view fs.image.thumbnail.mixin.form (in fs_image_thumbnail) fs.image.thumbnail.mixin form New
fs_image_thumbnail_mixin_search_view fs.image.thumbnail.mixin.search (in fs_image_thumbnail) fs.image.thumbnail.mixin search New
fs_image_thumbnail_mixin_tree_view fs.image.thumbnail.mixin.list (in fs_image_thumbnail) fs.image.thumbnail.mixin list New
fs_thumbnail_form_view fs.thumbnail.form fs.thumbnail form Inherits fs_image_thumbnail_mixin_form_view
fs_thumbnail_search_view fs.thumbnail.search fs.thumbnail search Inherits fs_image_thumbnail_mixin_search_view
fs_thumbnail_tree_view fs.thumbnail.list fs.thumbnail list Inherits fs_image_thumbnail_mixin_tree_view
ir_attachment_form_view ir.attachment.form (in fs_image_thumbnail) ir.attachment form Inherits base.view_attachment_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (3)

New fields (6)
  • attachment_id Many2one → ir.attachment
    comodel_name='ir.attachment' help='Attachment containing the original image' ondelete='cascade' required=True string='Attachment'
  • base_name Char
    help='The thumbnail image will be named as base_name + _ + size_x + _ + size_y + . + extension.\nIf not set, the base name will be the name of the original image.This base name is used to find all existing thumbnail of an image generated for the same base name.' required=True args: 'The base name of the thumbnail image (without extension)'
  • mimetype Char
    compute='_compute_mimetype' store=True
  • name Char
    compute='_compute_name' store=True
  • size_x Integer
    required=True args: 'X size'
  • size_y Integer
    required=True args: 'Y size'
Public methods (2)
  • get_or_create_thumbnails(self, *images: <expr>, sizes: <expr>, base_name: str='') -> <expr>
    @api.model
    Get or create a thumbnail images from the given image. :param images: the list of images we want to get or create thumbnails :param sizes: the list of sizes to use to resize the image (list of tuple (size_x, size_y)) :param base_name: the base name of the thumbnail image (without extension) The base name must be set when multiple images are given. :return: an ordered dictionary where the key is the original image and the value is a recordset of thumbnail images. The order of the dict is the order of the images passed to the method.
  • get_thumbnails(self, *images: <expr>, base_name: str='') -> <expr>
    @api.model
    Get existing thumbnail images from the given image. :param images: a list of images we want to find existing thumbnails :param base_name: the base name of the thumbnail image (without extension) The base name must be set when multiple images are given. :return: a recordset of thumbnail images

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (1)
  • thumbnail_ids One2many → fs.thumbnail
    comodel_name='fs.thumbnail' inverse_name='attachment_id' string='Thumbnails'
Public methods (0)

No public methods.

Loading…

Loading…