Skip to content

Commit

Permalink
[FIX] project: deal with corner case in domain_remove_leaf
Browse files Browse the repository at this point in the history
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 #93225

closes #108164

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
  • Loading branch information
Hugo Carlier (Huca) committed Dec 16, 2022
1 parent 05a8abd commit 4457807
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _process_leaf(elements, index, operator, new_domain):
# 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)
Expand Down

0 comments on commit 4457807

Please sign in to comment.