[FIX] ir_property: Allows to search on boolean == False
Closes #43580 Fixes #9449 Adds field type conditions for boolean in search for Property model. As False values are not stored in DB for boolean, the search() does not return any value for non existent lines with: * operator: '=' and value: False * operator: '!=' and value: True Uses the 'include_zero' and inverse operator mechanisms implemented in Property model. Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
@@ -418,7 +418,13 @@ class Property(models.Model):
|
||||
elif value > 0 and operator == '<':
|
||||
operator = '>='
|
||||
include_zero = True
|
||||
|
||||
elif field.type == 'boolean':
|
||||
if not value and operator == '=':
|
||||
operator = '!='
|
||||
include_zero = True
|
||||
elif value and operator == '!=':
|
||||
operator = '='
|
||||
include_zero = True
|
||||
|
||||
# retrieve the properties that match the condition
|
||||
domain = self._get_domain(name, model)
|
||||
|
||||
Reference in New Issue
Block a user