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 search many2one field by other than "name" field?

By
Antanas
on 10/2/13, 5:35 AM 3,272 views

Hello,

My goal is to achieve different behavior with many2one fields, consisting of two parts:

  1. Display a join of 2 fields ("name" field and another char field) as a name in view fields of many2one relations;
  2. To search by join of those 2 fields in view fields of many2one relations;

1. I have achieved by changing name_get() method, but how to achieve 2.?

Search is only available by "name" field. If there was a way to enable many2one search by other than "name" field, then searching by a functional field, which joins those 2 fields, would do great.

How to search on many2one field by other than "name" field?

4

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
4136
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 10/2/13, 6:24 AM

Hi,

for 1 and 2 you have an example in file product/product.py class product_product.

1 : def name_get

2 : def name_search

Bye

-1
bruce oldakowski
On 10/3/13, 7:38 AM

Hi,

Thanks for your answer, can you explain more please ? i try some solutions but it's not good...

Have a good day

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)

Stats

Asked: 10/2/13, 5:35 AM
Seen: 3272 times
Last updated: 3/16/15, 8:10 AM