Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
7611 Vizualizări

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"/>

</record>

    <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?

Imagine profil
Abandonează

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/

Cel mai bun răspuns

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.

Imagine profil
Abandonează
Autor

Thank you!!!!!

Related Posts Răspunsuri Vizualizări Activitate
2
nov. 23
3248
7
apr. 21
20691
1
oct. 20
5005
1
mai 18
8705
2
nov. 16
4331