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

Why my many2many field does not appear in the advanced search filter?

By
Juan Formoso
on 1/12/15, 4:28 AM 888 views

I've added a new field to the res.partner model. This field dummy is a many2many, related to a customized model named res.partner.link.category. In the tree view of partners, if I click on search and then on advanced search, I can create a new filter, selecting a field from res.partner and setting its value/s.

The problem is that I can't see my new field in the advanced search. There's an existing many2many field in res.partner, named category_id, and I can see this one there, in the advanced search. I need my field to behave like that one.

Can anyone help me, please?

1

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3883
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 1/12/15, 4:31 AM

If you need to search using Advanced search, then the field needs to be available in your database.  i.e. store=True is a must.

So, add store=True for your related field.

Thank you! That's a good point, but I've just found the problem and in my case was the one I'm going to post now.

Juan Formoso
on 1/12/15, 4:54 AM
0
Juan Formoso
On 1/12/15, 4:56 AM

In my case, the problem is that my table res.partner.link.category didn't have a column named name, and it didn't have set the attribute _rec_name, so it was impossible to find anything.

Not necessarily. You can still have a name_search method defined to be used to search the records. But I guess, it is not currently available as well.

Ivan
on 1/12/15, 5:44 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

2 follower(s)

Stats

Asked: 1/12/15, 4:28 AM
Seen: 888 times
Last updated: 3/16/15, 8:10 AM