How can I create a custom filter where the selection criteria are expressed across company contacts and person contacts? For example, I'd like to search for all person contacts who have a specific tag who are associated with company contacts that have a different specific tag. The result would be a list that contains only contacts that meet the individual and company search criteria.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
To verify the filter that is created (or to even manually create the expression) I'd suggest you to first enable the Developer mode (https://www.odoo.com/documentation/18.0/applications/general/developer_mode.html). Doing so you will see additional information when creating a filter.
Furthermore, I'd like to suggest you to save the created search (even if it's just partial one at that point) as a favorite. This way you can establish a base line filtering and work from there without constantly needing to rebuild the filter from scratch all the time.
That being said, a filter meeting your criteria could look like this:
["&", ("parent_id.category_id", "in", [10, 11]), ("category_id", "in", [8, 9])]
Note:
category_id 8 = 'abc'
category_id 9 = 'xyz'
category_id 10 = '123'
category_id 11 = '456'
The sample set of data looks like this:
With above filter, you're result will be:
Whether or not you want '=' (is equal) or 'has' (in) filters, depends on your exact requirement. But, given above Search Domain snippet (a Search Domain is a filter expression) you should be able to easily tweak it. You can also copy and paste it into the 'Code editor' field in the Custom Filter (when Developer Mode is active.
The UI version of this filter looks like this:
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
3
Sep 25
|
398 | ||
|
1
Sep 25
|
1787 | ||
|
0
Jul 25
|
1083 | ||
|
1
May 25
|
1774 | ||
ADD PROPERTIES
Solved
|
|
1
May 25
|
5060 |