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.

0

Make fields searchable in openerp 7

By
Sascha Pfeiffer
on 8/22/14, 2:57 AM 2,023 views

By default only the "_rec_name" field is searchable (in my case its "title").

http://s14.directupload.net/images/140822/6h3ikb6j.jpg

How can I make other fields searchable too? e.g. "description"

My tree view looks like:

 

 

        <record model="ir.ui.view" id="projects_tree">
            <field name="name">Projects</field>
            <field name="model">blub.projects</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Projects">
                    <field name="title"/>
                    <field name="description" />
                    <field name="filter" />
                </tree>
            </field>
        </record>

Thanks in advance for everyone helping me with my "stupid" questions :)

2
Cyril Sester
On 8/22/14, 3:18 AM

You have to add a new record to your view having a search tag.

<record model="ir.ui.view" id="projects_search">
            <field name="name">Projects</field>
            <field name="model">blub.projects</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
            <search string="Search project">
                <field name="description" string="Description" />
           </search>
        </field>
    </record>

You can also add filter with tag

                <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Projects"/>

And grouping with :

                <group expand="0" string="Group By...">
                    <filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
                </group>

Best regards,

Cyril

Thank you very much!

Sascha Pfeiffer
on 8/22/14, 5:21 AM

You're welcome. If the answer solves your question, set it as "accepted answer" :)

Cyril Sester
on 8/22/14, 6:06 AM
1

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 8/22/14, 3:21 AM

In the Search View add the fields that you want to show in search box.

Example

<record model="ir.ui.view" id="projects_search">
            <field name="name">Projects</field>
            <field name="model">blub.projects</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Projects">
                    <field name="title"/>
                    <field name="description" />
                    <field name="filter" />
                     </search>
            </field>
        </record>

thank you very much!

Sascha Pfeiffer
on 8/22/14, 5:21 AM

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

1 follower(s)

Stats

Asked: 8/22/14, 2:57 AM
Seen: 2023 times
Last updated: 3/16/15, 8:10 AM