Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I am attempting to create filters to segment my database. For me it makes sense to use the first letter of Name. i.e. Contacts starting with A, B, C, etc, along with a tag. It seems thought that I get records in multiple filters because it returns contacts that FIRST OR LAST name begin with that letter of the Alphabet. E.g. Doctor Hoffman Will appear in both the D filter and the W filter where I only want him to appear once. I am using this filter for instance:
[['category_id', '=', 'UK Import'], ['name', '=like', 'C']]
What am I doing wrong? Why is it looking in both the First and Last name and not just the first letter of the name field?
Hope someone can help
I'm afraid this can't be achieved, all string LIKE/NOT LIKE comparison operators end up matching substrings, either case sensitive or insentitive, please see here:
Notice how the right leaf (the query parameter) is automatically wrapped in '%' wildcards lines below to end as '%%%s%%' (which evaluates to '%my_search_criteria%').
Filters use search by default, which in turn end using domain expressions and hence the above limitation.
Using the exact match operator '=' prevents wrapping the search criteria in wildcards but then any wildcards explicitly provided in the search criteria (like in 'my_search_criteria%') are not taken into account.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 10/28/15, 5:00 PM|
|Seen: 602 times|
|Last updated: 4/11/16, 10:22 AM|