[FIX] project: deal with corner case in domain_remove_leaf
The method domain_remove_leaf is used to remove leaves from a domain corresponding to given fields. The particular case ['|', leaf_to_remove, leaf_to_remove] is replaced by [true_leaf] however the check of the second element of this subdomain was incorrectly done. This fix addresses this issue. Fixes https://github.com/odoo/odoo/pull/93225 closes odoo/odoo#108188 X-original-commit: 44578077b16b540a0270ea7257f902a2e917f79c Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
@@ -32,7 +32,7 @@ def remove_domain_leaf(domain, fields_to_remove):
|
||||
# Special case to avoid OR ('|') that can never resolve to true
|
||||
if leaf == OR_OPERATOR \
|
||||
and len(elements[index + 1]) == 3 and len(elements[index + 2]) == 3 \
|
||||
and elements[index + 1][0] in fields_to_remove and elements[index + 1][0] in fields_to_remove:
|
||||
and elements[index + 1][0] in fields_to_remove and elements[index + 2][0] in fields_to_remove:
|
||||
new_domain.append(TRUE_LEAF)
|
||||
return 3
|
||||
new_domain.append(leaf)
|
||||
|
||||
Reference in New Issue
Block a user