Skip to Content
Menu
This question has been flagged
1 Reply
737 Views

Hello,


I added a domain to a many2many relationship in calendar_events.py:

partner_ids = fields.Many2many(
'res.partner', 'calendar_event_res_partner_rel',
string='Attendees', default=_default_partners,
domain=[("employee", "=", True)])

(see Github for full context)

I would expect this to only find partners with employee = True.
But the domain seems to be ignored in all the views (e.g. calender_events.xml where partner_ids is referenced)

I made sure that I edited the right relationship by changing the name to "Attendees Test" and THAT change was reflected in the views I wanted - the domain not.


What am I getting wrong here?


Thank you


Sebastian

Avatar
Discard
Best Answer

Hello @sebels 

domain is ignored because of this default=_default_partners, or you can include that employee domain in _default_partners method.

Avatar
Discard