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
def search_rec_name(cls, name, clause):
res = super(Product, cls).search_rec_name(name, clause)
return ['OR',
res,
[('variant_name', ) + tuple(clause[1:])]
domain = super(Product, cls).search_rec_name(name, clause)
if clause[1].startswith('!') or clause[1].startswith('not '):
bool_op = 'AND'
else:
bool_op = 'OR'
return [bool_op,
domain,
('variant_name', ) + tuple(clause[1:])
]