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

How to add search filters for partners (city, phone no. ...)

By
NSC
on 9/24/14, 5:04 AM 2,056 views

In my Odoo v7 installation, I want to extend "direct" filtering for partners by interactive input inside the textbox on the right above partner list (without having to use extended filtering by arrow on the right side). There appears a popup with 2 entries - description or tags - which has to be select one from after having finished typing.  What I want to do is to add a third entry there (in addition to description an tags) with phone number. I already have a custom module with an inherited partner view - I think this has to come there. Right? How can I do this?

0
NSC
On 9/24/14, 10:06 AM

I have just had a look at about how it is handled in res_partner_view. It has to be something similar like below.
I did not have any opportunity yet to test it - maybe with your help I can know in advance which mistakes there are...

<record model='ir.ui.view' id='view_res_partner_filter'>
    <field name='name'>res.partner.select.inherit.base.partner.filter</field>
    <field name='model'>res.partner</field>
    <field name='inherit_id' ref='base.view_res_partner_filter'/>
    <field name='arch' type='xml'>
        <field name="name" position="after">
            <field name="phone" string="Telephone" filter_domain="[('phone','ilike', self)]"/>
            <field name="city" string="City" filter_domain="[('city','ilike', self)]"/>
                </field>
    </field>
</record>

 

// Edit: That's it! Exactly does what I expected!

0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 9/24/14, 6:59 AM

You should inherit the search view of res.partner.  Example can be found in crm_partner_assign/res_partner_view.xml in which base.view_res_partner_filter is added with another field to search from: grade_id.

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: 9/24/14, 5:04 AM
Seen: 2056 times
Last updated: 3/16/15, 8:10 AM