Odoo Help


How do I specify the tree view to use for the 'search more' popup of a many2one?

Karel Marissens
on 6/6/13, 10:03 AM 4,993 views


  • Open up an applicant
  • Edit.
  • Open the dropdown for 'contact' and select 'search more'.
  • A tree view of results is displayed with the name/phone number/email of the partner.

I want to add a field (example: street, country, ...) to this result screen. How do I accomplish that?

I tried:

  • Inline tree tag inside the contact field
  • 'tree_view_ref' in the context of the contact field

Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 10/5/13, 3:08 PM

You have to create your custom tree view in your custom module and then inherit the applicant's view and then add attribute context="{'tree_view_ref': 'your_tree_view_id'}" in context (partner_id) field.

Like this:

<record id="inherit_view_partner_tree" model="ir.ui.view">
    <field name="name">res.partner.inherit.tree</field>
    <field name="model">res.partner</field>
    <field eval="8" name="priority"/>
    <field name="arch" type="xml">
        <tree string="Contacts">
            <field name="name"/>
            <field name="phone"/>
            <field name="email"/>
            <field name="street"/>
            <field name="country_id"/>

<record id="inherit_crm_case_form_view_job" model="ir.ui.view">
    <field name="name">Jobs - Recruitment Form</field>
    <field name="model">hr.applicant</field>
    <field name="inherit_id" ref=" hr_recruitment.crm_case_form_view_job "
        <field name="partner_id" position="attributes">
            <attribute name="context">{'tree_view_ref': 'inherit_view_partner_tree'}</attribute>

Hi, thanks for your answer ...why should it be in context "partner_id" field, could it be in another field?

MEXYTUL, Diego Calzadilla
on 10/5/13, 9:27 PM

I have the following problem, could you take a look and give me some advice?? Thanks in advance!! http://help.openerp.com/question/33086/sale-order-generation-from-product-search/

MEXYTUL, Diego Calzadilla
on 10/5/13, 9:28 PM

This worked for me. Thanks for your example. PS: I happened to notice what appears to be a typographical error in your answer, in the first paragraph. There is an extra {"> in context="{">{'tree_view_ref': 'your_tree_view_id'}".

Devvyn Murphy
on 1/21/14, 7:56 PM

It's worth noting that user-created views won't be addressable in this manner until they are processed by the CSV exporter, because they have no ID string at first, only a numeric ID. See question 22497.

Devvyn Murphy
on 1/21/14, 8:03 PM
Diego Calzadilla
On 10/5/13, 3:38 AM

Hi, Im having a similar problem, could you fix it??

That's a question, not an answer.

Devvyn Murphy
on 1/21/14, 7:26 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: 6/6/13, 10:03 AM
Seen: 4993 times
Last updated: 6/16/16, 1:11 PM