This question has been flagged
1 Reply
2681 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">

                       <xpath expr="/search[@string='Product']/group[2]/filter[@string='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>
        </record>

Thanks

Avatar
Discard
Best Answer

Not quite clear what you mean to do. Do you want to add a filter or a group-by clause to the products? 

Note: In order to create a group-by, the field you will group by MUST exist in the tree view!

Avatar
Discard