Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
72a5a43
product_multi_image: Module totally redone from old product_images
pedrobaeza Feb 13, 2015
cb1f6a2
[IMP] product_multi_image: Split model in abstract & concrete + bette…
yajo Nov 6, 2015
db73bf9
Fix bugs found in review time, improve README.
yajo Mar 11, 2016
e1f8993
product_multi_image: Handle images in variants
pedrobaeza Apr 26, 2016
2f2b840
[MIG] product_multi_image: Upgrade to v9
lasley Nov 4, 2016
4adfe2d
[MIG] product_multi_image: Upgrade to v10
lasley Nov 4, 2016
67cc641
[fix] prod image update broken w/ no image on template #228
simahawk Feb 8, 2017
67da859
[IMP] product_multi_image: Improve uninstall hook to move images from
Jun 13, 2018
57d67d7
[FIX] product_multi_image: Do not resize large image to small/medium
Jul 5, 2018
eaeed36
[FIX] product_multi_image: Fix image removal from variants
Jul 20, 2018
61856e8
[MIG] product_multi_image: Migration to 12.0
MPoch-PlanetaTIC Jun 12, 2020
fa521b6
[IMP] product_multi_image: black, isort, prettier
hailangvn May 21, 2021
795dfa3
[MIG] product_multi_image: Migration to 14.0
hailangvn May 21, 2021
4ea5061
[IMP] product_multi_image: show images in product variant easy edit view
hailangvn May 22, 2021
b89263e
[MIG] product_multi_image 15.0
flachica May 6, 2022
fdb5d7b
[UPD] Update product_multi_image.pot
Aug 25, 2022
16b3e8d
[UPD] README.rst
OCA-git-bot Aug 25, 2022
4f58f08
[UPD] README.rst
OCA-git-bot Sep 3, 2023
c7f91b0
Update translation files
weblate Oct 9, 2023
c671160
Translated using Weblate (Spanish)
Ivorra78 Oct 24, 2023
60bc416
Added translation using Weblate (Italian)
mymage Oct 30, 2023
1ed04c7
Translated using Weblate (Italian)
mymage Oct 31, 2023
cc6350b
[MIG] product_multi_image: Migration to 16.0
IJOL Aug 9, 2024
3e5da9a
[IMP] product_multi_image: BITVAX trivax improvements
IJOL Apr 1, 2026
01d9a34
[MIG] product_multi_image: Migration to 18.0
IJOL Apr 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 161 additions & 0 deletions product_multi_image/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
===========================
Multiple Images in Products
===========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6dc98dd3fc0494ff6c8f8250d65117a27e8f2cc176db276ff0573ad890116609
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
:target: https://github.com/OCA/product-attribute/tree/18.0/product_multi_image
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_multi_image
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module implements the possibility to have multiple images for a
product template, a.k.a. an image gallery.

**Table of contents**

.. contents::
:local:

Installation
============

To install this module, you need to:

- Install ``base_multi_image`` from
`OCA/server-tools <https://github.com/OCA/server-tools>`__.

Configuration
=============

You can manage your images at Product template level:

1. Go to *Sales > Products > Products* and choose a product template.
2. Go to the *Images* tab.
3. Add a new image or edit the existing ones.
4. You can select for which variants you want to make available the
image. Keep it empty for making visible in all.
5. Refresh the page.
6. The first image in the collection is the main image for the product
template.

Going to product variants form, you can manage also your images, but
take into account this behaviour:

1. Go to *Sales > Products > Product Variants* and choose a product
variant.
2. If you add an image here, the image is actually added to the product
template, and restricted to this variant.
3. When editing an existing image, the image is changed generally for
all the variants where is enabled, not only for this variant.
4. When removing an image from this form, if the image is only in this
variant, the image is removed. Otherwise, the image gets restricted
to the rest of the variants where is available.

|Try me on Runbot|

.. |Try me on Runbot| image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:target: https://runbot.odoo-community.org/runbot/135/9.0

Known issues / Roadmap
======================

- When you change the image on the product variant, the preview image of
the *Images* tab doesn't get refreshed until you refresh the browser,
or if you go to its template, but the image has been actually saved!
- The field "Available in these variants" appears when opening the image
from the product variant.
- Add logic for handling to add images with the same name that another
variant of the same template, renaming the new image to a unique name.
- Add logic for handling to add the same image in several variants to a
already in another variant for not duplicating bytes.
- Provide proper migration scripts from module product_images from 7.0.
- Migrate to v8 api when https://github.com/odoo/odoo/issues/10799 gets
fixed.
- If you try to sort images before saving the product variant or
template, you will get an error similar to
``DataError: invalid input syntax for integer: "one2many_v_id_62"``.
This bug has not been fixed yet, but a workaround is to save and edit
again to sort images.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_multi_image%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Antiun Ingeniería
* Tecnativa
* LasLabs

Contributors
------------

- Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
- Rafael Blasco <rafabn@antiun.com>
- Jairo Llopis <yajo.sk8@gmail.com>
- Dave Lasley <dave@laslabs.com>
- Shepilov Vladislav <shepilov.v@protonmail.com>
- Marc Poch Mallandrich <mpoch@planetatic.com>
- Hai Lang <hailn@trobz.com>
- `Greenice <https://www.greenice.com>`__:

- Fernando La Chica <fernandolachica@gmail.com>

Other credits
-------------

- The migration of this module from 12.0 to 14.0 was financially
supported by Camptocamp.

Original implementation
~~~~~~~~~~~~~~~~~~~~~~~

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

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/18.0/product_multi_image>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions product_multi_image/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3).

from . import models
from .hooks import post_init_hook, uninstall_hook
25 changes: 25 additions & 0 deletions product_multi_image/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# © 2014-2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Multiple Images in Products",
"version": "18.0.1.0.0",
"author": "Antiun Ingeniería, Tecnativa, LasLabs, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/product-attribute",
"category": "Product",
"development_status": "Beta",
"summary": "Add multiple images for a product, a.k.a. an image gallery.",
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
"depends": [
"base_multi_image",
"product",
],
"data": [
"views/image_view.xml",
"views/product_template_view.xml",
],
"installable": True,
}
25 changes: 25 additions & 0 deletions product_multi_image/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging

_logger = logging.getLogger(__name__)


try:
from odoo.addons.base_multi_image.hooks import (
pre_init_hook_for_submodules,
uninstall_hook_for_submodules,
)
except ImportError:
_logger.info("Cannot import base_multi_image hooks")


def post_init_hook(env):
pre_init_hook_for_submodules(env, "product.template", "image_1920")
pre_init_hook_for_submodules(env, "product.product", "image_variant_1920")


def uninstall_hook(env):
"""Remove multi images for models that no longer use them."""
uninstall_hook_for_submodules(env, "product.template", "image_1920")
uninstall_hook_for_submodules(env, "product.product", "image_variant_1920")
100 changes: 100 additions & 0 deletions product_multi_image/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_multi_image
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-05-21 10:58+0000\n"
"PO-Revision-Date: 2023-10-28 20:20+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: product_multi_image
#: model:ir.model,name:product_multi_image.model_base_multi_image_image
msgid " image model for multiple image functionality "
msgstr " modelo de imagen para la funcionalidad de imágenes múltiples "

#. module: product_multi_image
#: model_terms:ir.ui.view,arch_db:product_multi_image.image_form_view
msgid "(keep empty for being visible for all variants)"
msgstr "(dejar vacío para hacerlo visible para todas las variantes)"

#. module: product_multi_image
#: model_terms:ir.ui.view,arch_db:product_multi_image.image_kanban_view
msgid "<i>Visible in all variants</i>"
msgstr "<i>Visible en todas las variantes</i>"

#. module: product_multi_image
#: model:ir.model.fields,help:product_multi_image.field_base_multi_image_image__product_variant_ids
msgid ""
"If you leave it empty, all variants will show this image. Selecting one or "
"several of the available variants, you restrict the availability of the "
"image to those variants."
msgstr ""
"Si lo deja vacío, todas las variantes mostrarán esta imagen. Seleccionando "
"una o más de las variantes disponibles, restringirá la disponibilidad de la "
"imagen a esas variantes."

#. module: product_multi_image
#: model:ir.model.fields,field_description:product_multi_image.field_product_product__image_ids
#: model:ir.model.fields,field_description:product_multi_image.field_product_template__image_ids
#: model_terms:ir.ui.view,arch_db:product_multi_image.product_variant_easy_edit_view
#: model_terms:ir.ui.view,arch_db:product_multi_image.view_product_template_form_img_inh
msgid "Images"
msgstr "Imágenes"

#. module: product_multi_image
#: model:ir.model.fields,field_description:product_multi_image.field_product_product__image_main
#: model:ir.model.fields,field_description:product_multi_image.field_product_template__image_main
msgid "Main image"
msgstr "Imagen principal"

#. module: product_multi_image
#: model:ir.model.fields,field_description:product_multi_image.field_product_product__image_main_medium
#: model:ir.model.fields,field_description:product_multi_image.field_product_template__image_main_medium
msgid "Medium image"
msgstr "Imagen media"

#. module: product_multi_image
#: model:ir.model,name:product_multi_image.model_product_product
msgid "Product"
msgstr "Producto"

#. module: product_multi_image
#: model:ir.model,name:product_multi_image.model_product_template
msgid "Product Template"
msgstr "Plantilla de producto"

#. module: product_multi_image
#: model:ir.model.fields,field_description:product_multi_image.field_base_multi_image_image__product_variant_count
msgid "Product Variant Count"
msgstr "Nº de variantes"

#. module: product_multi_image
#: model:ir.model.fields,field_description:product_multi_image.field_product_product__image_main_small
#: model:ir.model.fields,field_description:product_multi_image.field_product_template__image_main_small
msgid "Small image"
msgstr "Imagen pequeña"

#. module: product_multi_image
#: model_terms:ir.ui.view,arch_db:product_multi_image.image_kanban_view
msgid "Visible in"
msgstr "Visible en"

#. module: product_multi_image
#: model:ir.model.fields,field_description:product_multi_image.field_base_multi_image_image__product_variant_ids
msgid "Visible in these variants"
msgstr "Visible en estas variantes"

#. module: product_multi_image
#: model_terms:ir.ui.view,arch_db:product_multi_image.image_kanban_view
msgid "variant(s)"
msgstr "variante(s)"
Loading
Loading