Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
29 changed files
with
1,409 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
=========================== | ||
Multiple Images in Products | ||
=========================== | ||
|
||
This module implements the possibility to have multiple images for a product | ||
template, a.k.a. an image gallery. | ||
|
||
Installation | ||
============ | ||
|
||
To install this module, you need to: | ||
|
||
* Install ``base_multi_image`` from | ||
`OCA/server-tools <https://github.com/OCA/server-tools>`_. | ||
|
||
Usage | ||
===== | ||
|
||
You can manage your images at Product template level: | ||
|
||
#. Go to *Sales > Products > Products* and choose a product template. | ||
#. Go to the *Images* tab. | ||
#. Add a new image or edit the existing ones. | ||
#. You can select for which variants you want to make available the image. | ||
Keep it empty for making visible in all. | ||
#. Refresh the page. | ||
#. 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: | ||
|
||
#. Go to *Sales > Products > Product Variants* and choose a product variant. | ||
#. If you add an image here, the image is actually added to the product | ||
template, and restricted to this variant. | ||
#. When editing an existing image, the image is changed generally for all | ||
the variants where is enabled, not only for this variant. | ||
#. 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. | ||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/135/10.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 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 | ||
------------ | ||
|
||
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> | ||
* Rafael Blasco <rafabn@antiun.com> | ||
* Jairo Llopis <yajo.sk8@gmail.com> | ||
* Dave Lasley <dave@laslabs.com> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
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 https://odoo-community.org. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). | ||
|
||
from . import models | ||
from .hooks import pre_init_hook, uninstall_hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 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": "10.0.1.0.0", | ||
"author": "Antiun Ingeniería, " | ||
"Tecnativa, " | ||
"LasLabs, " | ||
"Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"website": "https://www.tecnativa.com", | ||
"category": "Sales Management", | ||
"pre_init_hook": "pre_init_hook", | ||
"uninstall_hook": "uninstall_hook", | ||
"depends": [ | ||
"base_multi_image", | ||
"product", | ||
], | ||
"data": [ | ||
'views/image_view.xml', | ||
'views/product_template_view.xml', | ||
], | ||
'installable': True, | ||
"images": [ | ||
"images/product.png", | ||
"images/db.png", | ||
"images/file.png", | ||
"images/url.png", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
try: | ||
from openerp.addons.base_multi_image.hooks import ( | ||
pre_init_hook_for_submodules, | ||
uninstall_hook_for_submodules, | ||
) | ||
except ImportError: | ||
pass | ||
|
||
|
||
def pre_init_hook(cr): | ||
pre_init_hook_for_submodules(cr, "product.template", "image") | ||
pre_init_hook_for_submodules(cr, "product.product", "image_variant") | ||
|
||
|
||
def uninstall_hook(cr, registry): | ||
"""Remove multi images for models that no longer use them.""" | ||
uninstall_hook_for_submodules(cr, registry, "product.template", | ||
field="image", field_medium="image_medium", | ||
field_small="image_small") | ||
uninstall_hook_for_submodules(cr, registry, "product.product") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_multi_image | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 10.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2016-04-26 18:40+0000\n" | ||
"PO-Revision-Date: 2016-04-26 18:40+0000\n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \n" | ||
"Language: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: product_multi_image | ||
#: model: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:ir.ui.view,arch_db:product_multi_image.image_kanban_view | ||
#, fuzzy | ||
msgid "<i>Visible in all variants</i>" | ||
msgstr "Visible en todas las variantes" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.model.fields,help:product_multi_image.field_base_multi_image_image_product_variant_ids | ||
#, fuzzy | ||
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.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 | ||
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 | ||
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 | ||
msgid "Small image" | ||
msgstr "Imagen pequeña" | ||
|
||
#. module: product_multi_image | ||
#: model: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:ir.model,name:product_multi_image.model_base_multi_image_image | ||
msgid "base_multi_image.image" | ||
msgstr "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.ui.view,arch_db:product_multi_image.image_kanban_view | ||
msgid "variant(s)" | ||
msgstr "variante(s)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_multi_image | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 10.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.ui.view,arch_db:product_multi_image.image_form_view | ||
msgid "(keep empty for being visible for all variants)" | ||
msgstr "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.ui.view,arch_db:product_multi_image.image_kanban_view | ||
msgid "<i>Visible in all variants</i>" | ||
msgstr "" | ||
|
||
#. 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 "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.model.fields,field_description:product_multi_image.field_product_product_image_ids | ||
#: model:ir.ui.view,arch_db:product_multi_image.view_product_template_form_img_inh | ||
msgid "Images" | ||
msgstr "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.model.fields,field_description:product_multi_image.field_product_product_image_main | ||
msgid "Main image" | ||
msgstr "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.model.fields,field_description:product_multi_image.field_product_product_image_main_medium | ||
msgid "Medium image" | ||
msgstr "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.model,name:product_multi_image.model_product_product | ||
msgid "Product" | ||
msgstr "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.model,name:product_multi_image.model_product_template | ||
msgid "Product Template" | ||
msgstr "" | ||
|
||
#. 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 "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.model.fields,field_description:product_multi_image.field_product_product_image_main_small | ||
msgid "Small image" | ||
msgstr "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.ui.view,arch_db:product_multi_image.image_kanban_view | ||
msgid "Visible in" | ||
msgstr "" | ||
|
||
#. 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 "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.model,name:product_multi_image.model_base_multi_image_image | ||
msgid "base_multi_image.image" | ||
msgstr "" | ||
|
||
#. module: product_multi_image | ||
#: model:ir.ui.view,arch_db:product_multi_image.image_kanban_view | ||
msgid "variant(s)" | ||
msgstr "" | ||
|
Oops, something went wrong.