C. Hunteler
C. Hunteler

Reputation: 13

Customize Search Window Odoo 10

I'm busy creating a custom module for Odoo 10. Part of it is to make sure Products are displayed with a default Group By in the Search Window. I can't seem to find the view/template where that could be organised. Has anybody an idea? Thanks in advance.

Upvotes: 0

Views: 275

Answers (1)

Say you want to group by categ_id. Then all you need to do is add a new filter like this:

<filter name="groupby_categ_id"
string="Internal Category"
context="{'group_by': 'categ_id'}"/>

And you will have to add this filter by default with the action context:

<field name="context">
{'search_default_groupby_categ_id': 1}
</field>

edit:

You can also pass this as a context of a field as follows:

<field name="product_tmpl_id" 
context={'search_default_groupby_categ_id': 1}
/>

And then when clicking on Search more the filter will be on by default.

Upvotes: 1

Related Questions