Odoo Help


How to add custom search in product form based on some attribute name of products?

on 2/23/15, 9:19 PM 633 views

I  need a custom search in product form based on some attribute name of products

Suppose My Product name is Apple black ABC 12345 .I know only some attributes from the products like black ABC .When I enter  black ABC  in the product search view it should shown related product wl shown based on my attribute name(black ABC,).How to create  a custom Search for this task

This is my code-----------

 <record id="product_template_search_custom_view" model="ir.ui.view">
            <field name="name">product.template.customsearch</field>
            <field name="model">product.template</field>
             <field name="inherit_id" ref="product.product_template_search_view"/>
             <field name="arch" type="xml">
              <xpath expr="/search/field[@name='name']" position="before">
               <field name="ean13" string="EAN 13 Baarcode" domain="[('sale_ok','=',1)]"/>
                  <field name="attribute_ield"/> #how to add that search


Techno-Functional Associate with 7+ years of experience in Odoo (formerly known as OpenERP).

On 2/24/15, 12:25 AM

In Py class.. write a orm method called "name_search", in that you achieve the search however you want...

Refer for such methods in Standard objects, like res_partner etc..

can you give one example..

on 2/24/15, 12:27 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: 2/23/15, 9:19 PM
Seen: 633 times
Last updated: 3/16/15, 8:10 AM