Odoo Help

Welcome!

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.

0

How to add search in product

By
oussama
on 10/16/14, 12:50 PM 562 views

Hi

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'}"/>
                        </xpath>                    
                    <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)]"/>
                    
                </search>
            </field>
        </record>

 

Thanks

0

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

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

deep
On 10/22/14, 2:22 AM

Try like this

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

I believe your Xpath is not properly set...

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

oussama
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)

Stats

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