This module extends the functionality of any model to support conditional images (based on the record attributes) and to manage them either globally or by company.
The main goal behind this module is to avoid storing the same image multiple times. For example, for every partner, there is a related image (most of the time, it's the default one). With this module properly set up, it will be stored only one time and you can change it whenever you want for all partners.
WARNING: this module cannot be used on the same objects using the module base_multi_image.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Lets administrators define reusable images that are automatically shown on records based on conditions, avoiding duplicate image storage. A new "Conditional Images" menu appears under Settings > Technical.
This module adds a new "Conditional Images" menu under Settings > Technical where administrators can create image records. Each record has a name, the target model (e.g., a partner or product), an optional company, and a selector written as a Python expression. The selector can use the variable object to refer to the current record, so the image is shown only when the expression is true. If no selector is set, the image is always used.
When a model uses the conditional image consumer mixin, its image fields (image_1920, image_1024, image_512, image_256, image_128) are computed automatically. The system searches for conditional images matching the record's model and company, evaluates the selectors, and picks the first matching image. If the model has a company field, images from the same company are preferred; otherwise, images without a company are used. If no image matches, the image fields are empty.
This allows one image to be stored once and reused across many records, for example, a default partner image. The module only provides the framework; other modules must add the mixin to their models to benefit from it. Access rights allow all internal users to read conditional images, while only technical users (group_no_one) can create, edit, or delete them.
Depends on
Models and fields (2)
- conditional.image · new modelname, selector, company_id, model_name
- conditional.image.consumer.mixin · new modelimage_128, image_256, image_512, image_1024, image_1920
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: 5 confirmed, 4 with no information of 9 versions.
Sources · Odoo 16.0
Confirmed on 2026-11-03 in branch 16.0 of OCA/server-tools.
terminal Installation and usage
OCA documentation · Odoo 18.0Installation
Source · Odoo 18.0The sole purpose of this module is to add an abstract model to be inherited. So, you will not notice any changes on install.
To develop using this module, you have to inherit the abstract model conditional.image.consumer.mixin to the model that needs the conditional images:
class ResPartner(models.Model): _inherit = ['res.partner', 'conditional.image.consumer.mixin'] _name = 'res.partner'
Then, configure how the images will be selected for each record.
Usage
Source · Odoo 18.0Go to Technical Settings \> Settings \> Images to configure all the images. You can define images for specific objects, depending on the attributes and the company of the object.
The selector should return a boolean expression. All fields of the object are available to compute the result.
The system will first try to match an image with a company set up, then with the ones without a company. If your object does not have a company_id field, this check will be ignored and only images without a company will be used.
No verified information in OCA: Configuration.
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.