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 create 2 many2one fields ?

on 5/14/14, 4:06 AM 697 views

Hello to all , I want to ask how I can create 2 many2one fields which have a relation with two fields of the same class.


The problem is that both fields bring the same values of the fields of product.product . I want to create relation of many2one with two different fields of product.product. Please guide me

On 5/14/14, 5:24 AM

It's possible. I think the code is ok. Please show the xml.


Pls. try:

<field name="product"/>
<field name="my_products"/>

<field name="product"/>

on 5/14/14, 5:33 AM


| 5 2 8
Ahmadabad, India
On 5/14/14, 6:02 AM

By default many2one field will show name field of object(product.product) in search list. You might can overwrite the name_search method for showing the different field of product object. This may help you but not for sure.

but the problem is that in one many2one field , I do want to show names and its working ok . For the other many2one field, I want to relate other field. How can this be done ? It will be helpful if you please share some example or refer some link . Thanks

on 5/14/14, 6:09 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

0 follower(s)


Asked: 5/14/14, 4:06 AM
Seen: 697 times
Last updated: 3/16/15, 8:10 AM