Odoo Help


This community 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.


How to add search in product

on 10/16/14, 12:50 PM 542 views


How to add search by group in product

my code

<record id="product_myform_search" model="ir.ui.view">
            <field name="name">product.myform.search</field>
            <field name="model">product.product</field>
            <field name="type">search</field>
            <field name="inherit_id" ref="product.product_search_form_view" />
            <field name="arch" type="xml">
                <search string="Product">
                       <xpath expr="/search[@string='Products']/group[@string='Group by...']/field[@name='Category']" position="after">
                              <filter string="Famille"  icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'mfamille'}"/>
                              <filter string="Sous famille" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'sfamille'}"/>
                    <field name="ean13" string="EAN13" />                    
                    <field name="famille" string="famille" />
                    <field name="sfamille" string="sous famille" />
                    <field name="modele" string="modele" />
                    <field name="marque" string="marque" />
                    <field name='default_code' string="Réference interne"  filter_domain="['|',('default_code','ilike',self),('default_code','ilike',self)]"/>





| 5 4 7
Bangalore, India

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

On 10/22/14, 2:22 AM

Try like this

<xpath expr="//group[@string='Group By']" position="after">
         <filter string="Famille"  icon="terp-stock_symbol-selection" domain="[]" context=" {'group_by':'mfamille'}"/>

I believe your Xpath is not properly set...

Thanks deep , The code it works i just edit mfamille to famille thanks a lot

on 10/22/14, 3:53 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 10/16/14, 12:50 PM
Seen: 542 times
Last updated: 3/16/15, 8:10 AM