Skip to main content
License: AGPL-3

Multiple Images Base

This module extends the functionality of any model to support multiple images (a gallery) attached to it and allow you to manage them.

Installation

This module adds abstract models to work on. Its sole purpose is to serve as base for other modules that implement galleries, so if you install this one manually you will notice no change. You should install any other module based on this one and this will get installed automatically.

Usage

To manage all stored images, you need to:

  • Go to Settings > Configuration > Multi images.

… but you probably prefer to manage them from the forms supplied by submodules that inherit this behavior.

Development

To develop a module based on this one:

  • See module product_multi_image as an example.

  • You have to inherit model base_multi_image.owner to the model that needs the gallery:

    class MyOwner(models.Model):
        _name = "my.model.name"
        _inherit = ["my.model.name", "base_multi_image.owner"]
    
        # If you need this, you will need ``post_init_hook_for_submodules``
        old_image_field = fields.Binary(related="image_main", store=False)
  • Somewhere in the owner view, add:

    <field
        name="image_ids"
        nolabel="1"
        context="{
            'default_owner_model': 'my.model.name',
            'default_owner_id': id,
        }"
        mode="kanban"/>
  • If the model you are extending already had an image field, and you want to trick Odoo to make those images to multi-image mode, you will need to make use of the provided ~.hooks.pre_init_hook_for_submodules, like the product_multi_image module does:

    from openerp.addons.base_multi_image.hooks import \
        pre_init_hook_for_submodules
    
    
    def pre_init_hook(cr):
        pre_init_hook_for_submodules(cr, "product.template", "image")
        pre_init_hook_for_submodules(cr, "product.product", "image_variant")
Try me on Runbot

Known issues / Roadmap

  • OS file storage mode for images is meant to provide a path where Odoo has read access and the image is already found, not for making the module store images there. It would be nice to add that feature though.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Credits

Original implementation

This module is inspired in previous module product_images from OpenLabs and Akretion.

Contributors

Maintainer

Odoo Community Association

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.

Release files for odoo8-addon-base-multi-image 8.0.2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo8-addon-base-multi-image 8.0.2.0.1
File Interpreter ABI Platform
odoo8_addon_base_multi_image-8.0.2.0.1-py2-none-any.whl Python 2 none any Details

Release files / odoo8_addon_base_multi_image-8.0.2.0.1-py2-none-any.whl

Download URL odoo8_addon_base_multi_image-8.0.2.0.1-py2-none-any.whl
Size 330.2 kB
Tags Python 2
SHA-256 checksum
How to use checksums
165410150de15483398a0495f9e2f0d0e8b4438a0b584252027c7957e7207eb9
BLAKE2b-256 checksum
How to use checksums
9b5335fcc4e23d321c5136e6ed7d97c3ff2633c5ee83c188618f71fe6c13110e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/30.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.3

Release history Release notifications | RSS feed

This release

8.0.2.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page