Conditional Images
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.
Table of contents
Installation
The 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 abstract.conditional.image to the model that needs the conditional images:
class ResPartner(models.Model):
_inherit = ['res.partner', 'abstract.conditional.image']
_name = 'res.partner'
Then, configure how the images will be selected for each record.
Usage
Go 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.
| Technical name | base_conditional_image |
|---|---|
| Module version | 12.0.1.0.2 |
| Tulio versions | 1.0 |
| Category | Tools |
| Publisher | Contaura LLC
Ported to Tulio, tested and supported by Contaura LLC. |
| Original authors | Camptocamp, OCA |
| License | AGPL-3
Open source: you may use, change and share
this module under its license. The price covers the Tulio port, its testing on Tulio
1.0 and the download. |
| Requires (Tulio core) | base |
| Lines of code | 184 |
| Downloads | 0 |
| Released | 12/06/2026 |