What filters does Odoo API support (for example: >, < ...ect)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilitate
- Inventar
- PoS
- Proiect
- MRP
Această întrebare a fost marcată
The Odoo API supports various filters that you can use to query records based on specific conditions. Here are some commonly used filters in the Odoo API:
1. Equals (=): To filter records that match a specific value, you can use the equals operator. For example:
- `domain=[('field_name', '=', 'value')]`
2. Not Equals (!=): To filter records that do not match a specific value, you can use the not equals operator. For example:
- `domain=[('field_name', '!=', 'value')]`
3. Greater Than (>), Less Than ( - `domain=[('field_name', '>', value)]`
- `domain=[('field_name', '
4. Greater Than or Equal To (>=), Less Than or Equal To (<=): To filter records based on numerical or date fields, including the specified value, you can use greater than or equal to and less than or equal to operators. For example:
- `domain=[('field_name', '>=', value)]`
- `domain=[('field_name', '<=', value)]`
5. In: To filter records that match any value from a list of values, you can use the in operator. For example:
- `domain=[('field_name', 'in', ['value1', 'value2', 'value3'])]`
6. Not In: To filter records that do not match any value from a list of values, you can use the not in operator. For example:
- `domain=[('field_name', 'not in', ['value1', 'value2', 'value3'])]`
7. Like: To filter records based on a pattern or substring match, you can use the like operator. It supports wildcard characters: % represents any number of characters, and _ represents a single character. For example:
- `domain=[('field_name', 'like', 'abc%')]`
- `domain=[('field_name', 'like', '%xyz')]`
- `domain=[('field_name', 'like', '_a%b_')]`
8. Not Like: To filter records that do not match a specific pattern or substring, you can use the not like operator. For example:
- `domain=[('field_name', 'not like', 'abc%')]`
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Înscrie-te| Related Posts | Răspunsuri | Vizualizări | Activitate | |
|---|---|---|---|---|
|
|
1
dec. 25
|
197 | ||
|
|
0
dec. 25
|
250 | ||
|
|
1
dec. 25
|
412 | ||
|
|
2
nov. 25
|
492 | ||
|
|
1
nov. 25
|
2402 |
Is this documented?