콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
12277 화면

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?

아바타
취소
작성자 베스트 답변

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


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

아바타
취소
베스트 답변

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

관련 게시물 답글 화면 활동
3
3월 24
4414
1
11월 22
2370
2
3월 18
11660
1
8월 24
1663
0
2월 24
1763