Odoo Help


Opening a tree with with Filter

tim diamond
on 10/30/13, 9:32 PM 1,945 views

Hi community.

I've spent hours looking through example code from the trunk, but I can't figure out what I'm doing wrong.

I have a menu entry that should open my product list. I want this action to automatically filter the items (with adding a filter in the top right search box) by a custom field called "big". Here is my code:

<record id="product_product_big" model="ir.actions.act_window">

<field name="name">Products</field>

<field name="type">ir.actions.act_window</field>

<field name="res_model">product.product</field>

<field name="view_type">form</field>

<field name="view_mode">kanban,tree,form</field>

<field name="context">{"search_default_big":0}</field>

<field name="view_id" ref="product.product_product_tree_view"/>

<field name="search_view_id" ref="product.product_search_form_view"/>


    <menuitem id="ingresos_mend" action = "product_product_big" sequence="1" parent="menu_purchase_container" name="Ingreso de Notas de Pedido" />

I can click on the menu, and a list of products come up. But nothing is in the search box (no filter)! And the products are not filtered (all products are showing).

I've studied the source code. I want exact similiar funcionality as when you click Clients vs. Suppliers, the res.partner objects are already filtered (showing a filter in the top right search box) by Client or Supplier.

How can this be accomplished?

you can see with click below of this link.it's ever been discussed. . http://help.openerp.com/question/17225/inherit-search-view-in-openerp7/

on 10/31/13, 12:29 AM

Grover Menacho

--Grover Menacho--
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Odoo Developer

Grover Menacho
On 10/31/13, 12:28 AM

Ok, first of all you have to add filter name big on your search view, that's in product_search_form_view. Then you are going to be able to filter with that field by default.

Second, <field name="context">{"search_default_big":0}</field> must be <field name="context">{"search_default_big":1}</field>

Because 0 is false and 1 is true.

Thank you!!!!!

tim diamond
on 11/1/13, 3:13 PM

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/30/13, 9:32 PM
Seen: 1945 times
Last updated: 3/16/15, 8:10 AM