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 can't I use filter_domain on a many2one field in a form?

By
Miku Laitinen
on 8/28/14, 9:52 AM 629 views

I'm trying to create a customer dropdown field on a form. In addition to the ability to search a customer by name the users should be able to search a customer by their internal reference (field 'ref' in res.partner). This would be trivial in a search view by using

filter_domain="['|', ('name', 'ilike', self), ('ref', 'ilike', self)]"

as the filter_domain, but it seems that in the form view the filter_domain attribute of the xml field definition is ignored.

Is there any way around this other than overriding the name_search() method?

 

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

1 follower(s)

Stats

Asked: 8/28/14, 9:52 AM
Seen: 629 times
Last updated: 3/16/15, 8:10 AM