Odoo Help


Product template search view wrong behavior

Diego Calzadilla
on 3/26/15, 12:57 PM 1,332 views

In product template search view is defined a field to do search by product attributes:

<field string="Product Variant" name="product_variant_ids" filter_domain="['|', ('product_variant_ids.name','ilike',self), ('product_variant_ids.attribute_value_ids.name','ilike',self)]"/>

product_variants_ids is a one2many field in product.template. When I write some attribute value, it brings the correct record, but when I write the atrribute name, it brings nothing, for example, in attribute page for some product I have:

MEMORY   32gb

COLOR      red

If I type 32gb, it brings record, whereas if I type MEMORY, brings nothing

Can any one help me? I would also like to understand filter_domain of this example.


Diego Calzadilla
On 3/27/15, 1:50 AM

     <field string="Product Variant" name="product_variant_ids" filter_domain="['|', ('product_variant_ids.name','ilike',self), ('product_variant_ids.attribute_value_ids.name','ilike',self), ('product_variant_ids.attribute_value_ids.attribute_id.name','ilike',self)]"/>

I tried this in order to keep both types of search, but didn't work, any suggestions?

MEXYTUL, Diego Calzadilla
on 3/27/15, 1:51 AM

You need to add an or ("|") before... |, |, cond1, cond2, cond3

Jérémy Kersten (jke)
on 3/27/15, 3:08 AM

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--

| 3 3 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 3/26/15, 6:26 PM

Hello, It's a bug...

The right domain should be : 

<field string="Product Variant" name="product_variant_ids" filter_domain="['|', ('product_variant_ids.name','ilike',self), ('product_variant_ids.attribute_value_ids.attribute_id.name','ilike',self)]"/>

You can change this one in view directly !

Fix merged in V8 : https://github.com/odoo/odoo/commit/42aa9096d9c1aa54529960e70590335660e33d12 

Thank you, it works!! However, search by attribute value is lost, I would like to keep both types of search. I tried something like this: And didn't work, any suggestions?

MEXYTUL, Diego Calzadilla
on 3/27/15, 1:49 AM
MEXYTUL, Diego Calzadilla
on 3/27/15, 1:49 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 3/26/15, 12:57 PM
Seen: 1332 times
Last updated: 3/28/17, 4:15 AM