跳至內容
選單
此問題已被標幟

Hi Odoo Community,


I’m working on Odoo v18 and trying to apply a custom domain to the partner_ids field inside the calendar view. However, the widget in use is many2manyattendeeexpandable and it seems to ignore the usual XML domain definitions.


Here’s what I tried so far inside my XML:

<field name="partner_ids"
       domain="[('employee_ids', '!=', False)]"
       context="{'domain': [('employee_ids', '!=', False)]}"
       options="{'block': True, 'icon': 'fa fa-users', 'domain': [('employee_ids', '!=', False)]}"
       filters="1"
       widget="many2manyattendeeexpandable"
       write_model="calendar.filters"
       write_field="partner_id"
       filter_field="partner_checked"
       avatar_field="avatar_128"/>

I also tried updating the domain in the model itself by extending partner_ids via Python, but the widget still ignores it.


It looks like this widget bypasses the domain and does a direct name_search RPC to res.partner, but none of the XML domain or options.domain seem to affect it.


Has anyone successfully limited the selectable partners in calendar attendee fields to a subset (e.g., only partners where employee_ids != False)?


Is there a clean way to hook into many2manyattendeeexpandable and inject a domain, or do I need to override the widget logic in JS entirely? If so did anyone already did that?


Thanks in advance for your help!

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
12月 20
3206
0
6月 17
4200
0
4月 15
7882
1
7月 22
6130
0
2月 25
18