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

[Solved] Filtering res.partner for contact (child_ids) - Odoo8

By
Siobhan
on 6/10/15, 3:34 AM 912 views

I have a test company created with 2 contacts.

I would like that in my module when I select the Company (marked is company) that in another field it only shows contact for that company

In developer mode, I found contacts to have name "child_ids" and I thought maybe if I added this:

<field name="res_partner_id" domain="[('child_ids', '=', True)]" />

it would work:

However it gives error:


ProgrammingError: operator does not exist: integer = boolean

LINE 1: SELECT "parent_id" FROM "res_partner" WHERE "id" IN (true)

^

HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.


Any ideas on how to fix this?

0
Siobhan
On 6/11/15, 2:59 AM

Found solution. It needs to be filter on the parent not the child:


<field name="res_partner_id" domain="[('parent_id', '=', res_partner_id)]" />

0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 6/10/15, 2:09 PM

Try this (False is set when list is empty, if is not empty .... not equals True):

<field name="res_partner_id" domain="[('child_ids', '!=', False)]" /> 

Thanks Zbik but that just gave me the customer names and not the contacts associate with the customer

Siobhan
on 6/11/15, 1:49 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

1 follower(s)

Stats

Asked: 6/10/15, 3:34 AM
Seen: 912 times
Last updated: 6/11/15, 2:59 AM