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
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
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:
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
InscribirsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
3
sept 25
|
397 | ||
|
1
sept 25
|
1784 | ||
|
0
jul 25
|
1082 | ||
Filters in multiple companies
Resuelto
|
|
1
may 25
|
1769 | |
ADD PROPERTIES
Resuelto
|
|
1
may 25
|
5017 |