تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
12160 أدوات العرض

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
مارس 24
4213
1
نوفمبر 22
2298
2
مارس 18
11503
1
أغسطس 24
1558
0
فبراير 24
1665