Odoo Help


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.


How to search a value from the xml structure ?

Yug Faa
on 3/19/13, 7:38 AM 2,247 views


I think that I saw one day a syntax like :

<field name="partner_id" search="[('name','like','company')] />

So today I need to use this feature, help me please

Thank you.


Andreas Brueckl

--Andreas Brueckl--
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 3/19/13, 7:53 AM

So you can set the partner_id of an object to the existing partner with XML-ID base.res_partner_23:

<field name="partner_id" eval="ref('base.res_partner_23')"/>

If you want to perform a search, then you can use this style:

<field name="menu_id" model="ir.ui.menu" search="[('name', '=', 'Waiting Delivery Orders')]"/>

I have not explained well my problem, when we want to search in the model account.account we don't have the XML structure, because it generated in the system.

Yug Faa
on 3/19/13, 7:56 AM

just updated my answer. Just saw that Mike has already posted the answer :)

Andreas Brueckl
on 3/19/13, 7:57 AM

Excatly is that what I look for, the search feature, the first one is static and I need some dynamic, Thank you

Yug Faa
on 3/19/13, 8:00 AM
Mike Telahun
On 3/19/13, 7:54 AM

You are essentially correct, but you should also include the model name: for example:

<field name="partner_id" model="res.partner" search="[('name','like',u'Mike%')]"/>

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

2 follower(s)


Asked: 3/19/13, 7:38 AM
Seen: 2247 times
Last updated: 3/16/15, 8:10 AM