Improve search_rec_name method of party

This commit is contained in:
jmartin 2016-04-11 16:44:14 +02:00
parent 92d5ef0455
commit f870375fa5
1 changed files with 8 additions and 4 deletions

View File

@ -28,8 +28,12 @@ class Product:
@classmethod @classmethod
def search_rec_name(cls, name, clause): def search_rec_name(cls, name, clause):
res = super(Product, cls).search_rec_name(name, clause) domain = super(Product, cls).search_rec_name(name, clause)
return ['OR', if clause[1].startswith('!') or clause[1].startswith('not '):
res, bool_op = 'AND'
[('variant_name', ) + tuple(clause[1:])] else:
bool_op = 'OR'
return [bool_op,
domain,
('variant_name', ) + tuple(clause[1:])
] ]