Fix search_rec_name for negative operator

In case of negative operator, each subclause must be composed with 'AND'.

issue4559
review11171002
This commit is contained in:
Cédric Krier committed 2015-04-05 23:39:10 +02:00
1 parent ed5b129685
commit eeb45c244e
1 file changed
+5 -1
+5 -1
View File
@@ -64,7 +64,11 @@ class Agent(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,
('party',) + tuple(clause[1:]),
('plan',) + tuple(clause[1:]),
]