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

Domain in many2many relation

By
José
on 1/6/15, 9:57 PM 794 views

Hello, I have Odoo8.

I have a model A with a many2many field which relates him with a model B. I want to filter this many2many field with a domain, which filters (not consider) all the B records which has one relation to any A record. How can I do this? Thanks!

@Ivan, thanks for your reply. In model B I don't have any reference to model A. How can count the number of model A related to model B in a function field?

José
on 1/7/15, 10:26 AM
1

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/6/15, 11:17 PM

Create a function field in model B that counts the number of model A that relates to it, and then filter/domain based on that function field.  You need to set the fnct_search for the function field as well.

I have a similar problem, my field is m2m and I like to filter if it has more them one line, like this domain="[[u'tag_ids', u'&gt', 1]], but did not work and I don't have any ideia of how to make a function to count the number of rows, could you give some help?

Cezar Jr
on 2/5/16, 5:27 PM

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: 1/6/15, 9:57 PM
Seen: 794 times
Last updated: 2/5/16, 5:46 PM