From 81bf997722a3bd07bab32dfa0440834ff021f728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 30 Mar 2019 20:39:05 +0100 Subject: [PATCH] Switch from OR-ed to AND-ed domain for search_rec_name of location issue8054 --- location.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/location.py b/location.py index 5796e41d9f..4c08adbf5f 100644 --- a/location.py +++ b/location.py @@ -297,7 +297,11 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView): @classmethod def search_rec_name(cls, name, clause): - return ['OR', + if clause[1].startswith('!') or clause[1].startswith('not '): + bool_op = 'AND' + else: + bool_op = 'OR' + return [bool_op, (cls._rec_name,) + tuple(clause[1:]), ('code',) + tuple(clause[1:]), ]