Rodney Enciso Arias пре 7 година
комит
aed952a873
41 измењених фајлова са 1295 додато и 0 уклоњено
  1. 90 0
      README.rst
  2. 1 0
      __init__.py
  3. BIN
      __init__.pyc
  4. 23 0
      __openerp__.py
  5. 14 0
      data/config_data.xml
  6. 40 0
      i18n/ca.po
  7. 40 0
      i18n/de.po
  8. 40 0
      i18n/el_GR.po
  9. 40 0
      i18n/es.po
  10. 40 0
      i18n/es_ES.po
  11. 40 0
      i18n/eu.po
  12. 40 0
      i18n/fi.po
  13. 38 0
      i18n/fr.po
  14. 40 0
      i18n/fr_CH.po
  15. 40 0
      i18n/fr_FR.po
  16. 40 0
      i18n/gl.po
  17. 40 0
      i18n/hr.po
  18. 40 0
      i18n/hr_HR.po
  19. 41 0
      i18n/it.po
  20. 40 0
      i18n/nl.po
  21. 40 0
      i18n/nl_NL.po
  22. 40 0
      i18n/pt.po
  23. 40 0
      i18n/pt_BR.po
  24. 40 0
      i18n/ro.po
  25. 42 0
      i18n/sl.po
  26. 40 0
      i18n/tr.po
  27. 40 0
      i18n/tr_TR.po
  28. 40 0
      i18n/vi_VN.po
  29. 40 0
      i18n/zh_CN.po
  30. 2 0
      models/__init__.py
  31. BIN
      models/__init__.pyc
  32. 34 0
      models/attribute.py
  33. BIN
      models/attribute.pyc
  34. 111 0
      models/product.py
  35. BIN
      models/product.pyc
  36. BIN
      static/description/1.png
  37. BIN
      static/description/2.png
  38. BIN
      static/description/icon.png
  39. 1 0
      tests/__init__.py
  40. 28 0
      tests/test_search.py
  41. 30 0
      views/product_view.xml

+ 90 - 0
README.rst

@@ -0,0 +1,90 @@
+.. 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
+
+=====================================
+Product Variants Search by Attributes
+=====================================
+
+
+Allows searching inside the product variant attributes:
+
+* All attributes at once
+* Multiple keyword at once
+
+
+
+Configuration
+=============
+
+#. Add technical settings to your user
+#. You may change the searching separator in System Parameter menu: the default one is a space
+
+Usage
+=====
+
+To use this module, you need to:
+
+
+#. Go to product variant menu
+#. Make a search as below
+
+
+.. figure:: product_variant_search_by_attribute/static/description/1.png
+   :alt: Search with multiple keywords
+   :width: 600 px
+**Search with multiple keywords at once**
+
+Each keywords are split with configured separator, here space.
+
+|
+
+.. figure:: product_variant_search_by_attribute/static/description/2.png
+   :alt: Result contains the only entry with attributes with `blac` and `16`
+   :width: 600 px
+**Result contains the only entry with attributes with 'blac' and '16'**
+
+
+
+.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
+   :alt: Try me on Runbot
+   :target: https://runbot.odoo-community.org/runbot/137/8.0
+
+
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues
+<https://github.com/OCA/product_variant/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
+=======
+
+Images
+------
+
+* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
+
+Contributors
+------------
+
+* David BEAL <david.beal@akretion.com>
+* Raphaël REVERDY <raphael.reverdy@akretion.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.

+ 1 - 0
__init__.py

@@ -0,0 +1 @@
+from . import models


+ 23 - 0
__openerp__.py

@@ -0,0 +1,23 @@
+# coding: utf-8
+# © 2016 David BEAL @ Akretion <david.beal@akretion.com>
+# © 2016 Raphaël REVERDY @ Akretion <raphael.reverdy@akretion.com>
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+{
+    'name': 'Product Variant Search by Attributes',
+    'summary': """Allows searching inside the product variant attributes
+                  all attributes at once with multiple keywords""",
+    'version': '8.0.1.0.0',
+    'category': 'Product',
+    'author': ['Akretion', 'Odoo Community Association (OCA)'],
+    'depends': [
+        'product',
+    ],
+    'website': 'http://www.akretion.com/',
+    'data': [
+        'data/config_data.xml',
+        'views/product_view.xml',
+    ],
+    'installable': True,
+    'license': 'AGPL-3',
+}

+ 14 - 0
data/config_data.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<openerp>
+<data noupdate="1">
+
+
+    <record id="search_by_attribute_separator" model="ir.config_parameter">
+        <field name="key">search.by.attribute.separator</field>
+        <field name="value"> </field>
+    </record>
+
+
+</data>
+</openerp>

+ 40 - 0
i18n/ca.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Eric Antones <eantones@users.noreply.github.com>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: Eric Antones <eantones@users.noreply.github.com>, 2016\n"
+"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: ca\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Producte"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/de.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
+"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: de\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Produkt"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/el_GR.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Kostas Goutoudis <goutoudis@gmail.com>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: Kostas Goutoudis <goutoudis@gmail.com>, 2016\n"
+"Language-Team: Greek (Greece) (https://www.transifex.com/oca/teams/23907/el_GR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: el_GR\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Προϊόν"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/es.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
+"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: es\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Producto"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/es_ES.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Javier García-Panach <panaka7@gmail.com>, 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-12-31 06:23+0000\n"
+"PO-Revision-Date: 2016-12-31 06:23+0000\n"
+"Last-Translator: Javier García-Panach <panaka7@gmail.com>, 2017\n"
+"Language-Team: Spanish (Spain) (https://www.transifex.com/oca/teams/23907/es_ES/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: es_ES\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Producto"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/eu.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Esther Martín Menéndez <esthermartin001@gmail.com>, 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-18 05:12+0000\n"
+"PO-Revision-Date: 2017-02-18 05:12+0000\n"
+"Last-Translator: Esther Martín Menéndez <esthermartin001@gmail.com>, 2017\n"
+"Language-Team: Basque (https://www.transifex.com/oca/teams/23907/eu/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: eu\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Produktua"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/fi.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2016\n"
+"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: fi\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Tuote"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 38 - 0
i18n/fr.po

@@ -0,0 +1,38 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# 	* product_variant_search_by_attribute
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-08-08 16:17+0000\n"
+"PO-Revision-Date: 2016-08-08 18:20+0200\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+"Language: fr\n"
+"X-Generator: Poedit 1.8.7.1\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr "Valeurs de caractér. (cherche tous les mots)"
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr "Chaine de caractéristique"
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Article"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid "Store all attribute values. Required to search variants from attributes"
+msgstr "Stock toutes les valeurs de caractéristiques. Requis pour chercher les variantes depuis les caractéristiques"

+ 40 - 0
i18n/fr_CH.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# leemannd <leemannd@gmail.com>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-29 14:59+0000\n"
+"PO-Revision-Date: 2016-11-29 14:59+0000\n"
+"Last-Translator: leemannd <leemannd@gmail.com>, 2016\n"
+"Language-Team: French (Switzerland) (https://www.transifex.com/oca/teams/23907/fr_CH/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: fr_CH\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Produit"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/fr_FR.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
+"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/fr_FR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: fr_FR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Produit"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/gl.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# César Castro Cruz <ulmroan@gmail.com>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: César Castro Cruz <ulmroan@gmail.com>, 2016\n"
+"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: gl\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Produto"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/hr.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Bole <bole@dajmi5.com>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: Bole <bole@dajmi5.com>, 2016\n"
+"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: hr\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Proizvod"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/hr_HR.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Bole <bole@dajmi5.com>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: Bole <bole@dajmi5.com>, 2016\n"
+"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: hr_HR\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Proizvod"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 41 - 0
i18n/it.po

@@ -0,0 +1,41 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+# Paolo Valier <paolo.valier@hotmail.it>, 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-01-14 05:29+0000\n"
+"PO-Revision-Date: 2017-01-14 05:29+0000\n"
+"Last-Translator: Paolo Valier <paolo.valier@hotmail.it>, 2017\n"
+"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: it\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr "Valori attributi (cerca tutte le parole)"
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Prodotto"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/nl.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
+"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: nl\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Product"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/nl_NL.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Mario Gielissen <mario@openworx.nl>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: Mario Gielissen <mario@openworx.nl>, 2016\n"
+"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: nl_NL\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Product"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/pt.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
+"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: pt\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Produto"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/pt_BR.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
+"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Produto"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/ro.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
+"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: ro\n"
+"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Produs"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 42 - 0
i18n/sl.po

@@ -0,0 +1,42 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+# Matjaž Mozetič <m.mozetic@matmoz.si>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>, 2016\n"
+"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: sl\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr "Vrednosti atributov (iskanje vseh besed)"
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr "Opis atributa"
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Proizvod"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""
+"Shrani vse vrednosti atributov. Potrebno je za iskanje variant iz atributov"

+ 40 - 0
i18n/tr.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Ivan BARAYEV <ivanbarayev@hotmail.com>, 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-12-31 06:23+0000\n"
+"PO-Revision-Date: 2016-12-31 06:23+0000\n"
+"Last-Translator: Ivan BARAYEV <ivanbarayev@hotmail.com>, 2017\n"
+"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: tr\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Ürün"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/tr_TR.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Ozge Altinisik <ozge@altinkaya.com.tr>, 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-12-31 06:23+0000\n"
+"PO-Revision-Date: 2016-12-31 06:23+0000\n"
+"Last-Translator: Ozge Altinisik <ozge@altinkaya.com.tr>, 2017\n"
+"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/tr_TR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: tr_TR\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Ürün"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/vi_VN.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# OCA Transbot <transbot@odoo-community.org>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
+"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/teams/23907/vi_VN/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: vi_VN\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "Sản phẩm"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 40 - 0
i18n/zh_CN.po

@@ -0,0 +1,40 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * product_variant_search_by_attribute
+# 
+# Translators:
+# Jeffery Chen Fan <jeffery9@gmail.com>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-11 03:45+0000\n"
+"PO-Revision-Date: 2016-11-11 03:45+0000\n"
+"Last-Translator: Jeffery Chen Fan <jeffery9@gmail.com>, 2016\n"
+"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: zh_CN\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. module: product_variant_search_by_attribute
+#: view:product.product:product_variant_search_by_attribute.product_search_form_view
+msgid "Attrib. values (search all words)"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: field:product.product,attribute_str:0
+msgid "Attribute string"
+msgstr ""
+
+#. module: product_variant_search_by_attribute
+#: model:ir.model,name:product_variant_search_by_attribute.model_product_product
+msgid "Product"
+msgstr "产品"
+
+#. module: product_variant_search_by_attribute
+#: help:product.product,attribute_str:0
+msgid ""
+"Store all attribute values. Required to search variants from attributes"
+msgstr ""

+ 2 - 0
models/__init__.py

@@ -0,0 +1,2 @@
+from . import attribute
+from . import product

BIN
models/__init__.pyc


+ 34 - 0
models/attribute.py

@@ -0,0 +1,34 @@
+# coding: utf-8
+# © 2016 David BEAL @ Akretion <david.beal@akretion.com>
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+import logging
+
+from openerp import api, models
+
+
+_logger = logging.getLogger(__name__)
+
+
+class ProductAttributeValue(models.Model):
+    _inherit = 'product.attribute.value'
+
+    @api.multi
+    def write(self, vals):
+        """ Attribute Values update impact products: we take care
+            to propagate changes on attribute_str field"""
+        res = super(ProductAttributeValue, self).write(vals)
+        if 'name' in vals:
+            sql = """SELECT prod_id
+                     FROM product_attribute_value_product_product_rel
+                     WHERE att_id = %s""" % self.id
+            self._cr.execute(sql)
+            product_ids = self._cr.fetchall()  # [(99999), (...)]
+            if product_ids:
+                product_ids = [x[0] for x in product_ids]
+                products = self.env['product.product'].browse(product_ids)
+                _logger.debug(" >>> '%s' products to update after attribute "
+                              "('%s') modified" % (len(product_ids), self.id))
+                products._compute_attrib_str_after_attrib_value_change()
+                _logger.debug(" >>> '%s' products update done")
+        return res

BIN
models/attribute.pyc


+ 111 - 0
models/product.py

@@ -0,0 +1,111 @@
+# coding: utf-8
+# © 2016 David BEAL @ Akretion <david.beal@akretion.com>
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+import itertools
+import logging
+
+from openerp import api, fields, models
+
+
+_logger = logging.getLogger(__name__)
+
+
+class ProductProduct(models.Model):
+    _inherit = 'product.product'
+
+    attribute_str = fields.Char(
+        string='Attribute string', compute='_compute_attribute_str',
+        store=True, index=True,
+        help="Store all attribute values. Required to search variants "
+             "from attributes")
+
+    @api.multi
+    @api.depends('attribute_value_ids', 'active')
+    def _compute_attribute_str(self):
+        for prd in self:
+            if prd.attribute_value_ids:
+                attrs = [x.name.lower() for x in prd.attribute_value_ids]
+                prd.attribute_str = u' '.join(attrs)
+
+    @api.multi
+    def _compute_attrib_str_after_attrib_value_change(self):
+        """ This method is called when you modified attribute value name
+            on impacted products: in this case you may have a huge data volume
+        """
+        sql = ''
+        product_ids = [x.id for x in self]
+        self._cr.execute(self._get_product_info_query(), (tuple(product_ids),))
+        product_infos = self._cr.fetchall()
+        products_map = {x[0]: x[1] for x in product_infos}
+        update_statement = "UPDATE product_product SET attribute_str = " \
+                           "%(info)s WHERE id = %(id)s;"
+        for prd in self:
+            if products_map.get(prd.id):
+                # We do not use previous method compute_attribute_str()
+                # for performance reason: ie 30 000 products to update
+                #     5 seconds with this method
+                #  or 3 minutes for _compute_attribute_str() method above
+                query_params = {'info': products_map[prd.id], 'id': prd.id}
+                sql += self._cr.mogrify(update_statement, query_params)
+        if sql:
+            self._cr.execute(sql)
+            self.env.invalidate_all()
+
+    def _get_product_info_query(self):
+        """ You may customize aggregate string according to your needs """
+        return """
+            SELECT re.prod_id as id, lower(string_agg(pa.name, ' ')) as string
+            FROM product_attribute_value_product_product_rel re
+               LEFT JOIN product_attribute_value pa ON pa.id = re.att_id
+            WHERE re.prod_id in %s
+            GROUP BY 1 """
+
+    def search(self, cr, uid, domain, offset=0, limit=None,
+               order=None, context=None, count=False):
+        _logger.debug('Initial domain search %s' % domain)
+        separator = self.pool['ir.config_parameter'].get_param(
+            cr, uid, 'search.by.attribute.separator', ' ')
+        domain = self.domain_replacement(domain, 'attribute_str', separator)
+        return super(ProductProduct, self).search(
+            cr, uid, domain, offset=offset, limit=limit, order=order,
+            context=context, count=count)
+
+    def domain_replacement(self, domain, field, separator):
+        """ convert [expr1, expr2, expr3] in [expr1, expr2a, expr2b, expr3]
+            according to expr => (field, 'ilike', mystring)
+        """
+        position = 0
+        domain_idx = []
+        for arg in domain:
+            # we track position of field in domain
+            if tuple(arg)[0] == field:
+                domain_idx.append(position)
+            position += 1
+        for position in reversed(domain_idx):
+            modified_domain = True
+            clauses = self.domain_split(domain[position][2], field, separator)
+            for clause in clauses:
+                domain.insert(position, clause)
+            # we remove initial expression with this field
+            del domain[position + len(clauses)]
+            if modified_domain:
+                _logger.debug('Modified domain attr. %s' % domain)
+        return domain
+
+    def domain_split(self, value, field, separator):
+        """ convert this string 'first second third' in this list
+            ['&', '&',
+             ('myfield', 'like', 'first'),
+             ('myfield', 'like', 'second'),
+             ('myfield', 'like', 'third')]
+        """
+        words = value.lower().split(separator)
+        # we create as many expression as words in this field
+        clauses = [[field, 'like', word] for word in words]
+        if len(clauses) > 1:
+            # we need explicit operator '&' to be compatible
+            # with complex domains using '|' operator
+            operators = list(itertools.repeat('&', len(clauses) - 1))
+            clauses = clauses + operators
+        return clauses

BIN
models/product.pyc


BIN
static/description/1.png


BIN
static/description/2.png


BIN
static/description/icon.png


+ 1 - 0
tests/__init__.py

@@ -0,0 +1 @@
+from . import test_search

+ 28 - 0
tests/test_search.py

@@ -0,0 +1,28 @@
+# coding: utf-8
+# © 2016 David BEAL @ Akretion <david.beal@akretion.com>
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from openerp.tests.common import TransactionCase
+
+
+class TestSearchByAttribute(TransactionCase):
+    def test_attribute_str(self):
+        self.assertEqual(self.ipod16.attribute_str, '16 gb')
+
+    def test_change_attribute_value(self):
+        self.attrib16.write({'name': '16 GBsuffix'})
+        self.assertEqual(self.ipod16.attribute_str, '16 gbsuffix')
+
+    def test_no_record_returned_by_search(self):
+        res = self.product_m.search([('attribute_str', 'ilike', '16 32')])
+        self.assertEqual(len(res), 0)
+
+    def test_one_record_returned_by_search(self):
+        res = self.product_m.search([('attribute_str', 'ilike', '16 blac')])
+        self.assertEqual(len(res), 1)
+
+    def setUp(self):
+        super(TestSearchByAttribute, self).setUp()
+        self.product_m = self.env['product.product']
+        self.ipod16 = self.env.ref('product.product_product_11')
+        self.attrib16 = self.env.ref('product.product_attribute_value_1')

+ 30 - 0
views/product_view.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<openerp>
+<data>
+
+
+    <record id="product_search_form_view" model="ir.ui.view">
+        <field name="model">product.product</field>
+        <field name="inherit_id" ref="product.product_search_form_view"/>
+        <field name="arch" type="xml">
+            <field name="product_tmpl_id" position="before">
+                <field name="attribute_str" string="Valor del atributo "/>
+            </field>
+        </field>
+    </record>
+
+
+    <record id="product_product_tree_view" model="ir.ui.view">
+        <field name="model">product.product</field>
+        <field name="inherit_id" ref="product.product_product_tree_view"/>
+        <field name="arch" type="xml">
+            <field name="name" position="after">
+                <field name="attribute_str" invisible="1"/>
+            </field>
+        </field>
+    </record>
+
+
+</data>
+</openerp>