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.

1

How to add a group by to search view of product?

By
Vikram
on 8/24/13, 4:14 AM 1,208 views

How to add a group by to search view of product master? I am unable to add my group_id ( customized one ) to search view of product form ? please refer a following code,

<record id="product_search_by_group_form_view" model="ir.ui.view">

        <field name="name">group.search.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_search_form_view"/>
        <field name="arch" type="xml">

               <filter name="consumable" position="before">
               <filter icon="terp-accessories-archiver-minus" string="Group" domain="[('group_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Sub Group" domain="[('sub_group_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Product Type" domain="[('type_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Product Sub Type" domain="[('sub_type_id', '!=', False)]" />

               <filter string="Type" position="after">
       <filter string='product-group' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' :'group_id'}"/>
               </filter>

               </filter>
        </field>

 </record>
0
alain@drgt.net
On 5/12/16, 11:12 AM

Should be:

<record id="product_search_by_group_form_view" model="ir.ui.view">

        <field name="name">group.search.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_search_form_view"/>
        <field name="arch" type="xml">

               <filter name="consumable" position="before">
               <filter icon="terp-accessories-archiver-minus" string="Group" domain="[('group_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Sub Group" domain="[('sub_group_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Product Type" domain="[('type_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Product Sub Type" domain="[('sub_type_id', '!=', False)]" />
               </filter>            
     <filter string="Type" position="after">
<filter string='product-group' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' :'group_id'}"/>
</filter>
</filter> </field> </record>

So, you forgot the fist filter position before.


Hope this helps,

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

0 follower(s)

Stats

Asked: 8/24/13, 4:14 AM
Seen: 1208 times
Last updated: 5/12/16, 11:12 AM