python - Use of domain in search of One2many field in List view in Odoo-9 -


i have one2many field product_attributes in product.template , value field in product.attributes.custom

class producttemplatecus(models.model):     _inherit = 'product.template'     product_attributes = fields.one2many('product.attributes.custom','product_id')  class productattributes(models.model):     _name = 'product.attributes.custom'     value = fields.char(string='value')     product_id = fields.many2one('product.template',string='product') 

product 1 product_attributes contains 2 values:

value= 'color: red' value= 'others: red' 

product 2 product_attributes contains 2 values:

value= 'color: white' value= 'others: red' 

i did below in search xml:

<field  name="product_attributes" string="color" filter_domain="['&amp;',('product_attributes.value','ilike','color'),('product_attributes.value','ilike',self)]" /> 

so if red searched, product 1 containing both color , red should shown. unable result. getting both products.

is there solution this?

afaik search_domain means nothing here. should use domain instead.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -