mirror of
https://github.com/NaN-tic/trytond-product_variant_unique-deprecated.git
synced 2023-12-14 02:13:07 +01:00
Improve search_rec_name method of template
This commit is contained in:
parent
3c4f48b18e
commit
3b790fd4e2
11
product.py
11
product.py
|
@ -40,8 +40,15 @@ class Template:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def search_rec_name(cls, name, clause):
|
def search_rec_name(cls, name, clause):
|
||||||
return ['OR', super(Template, cls).search_rec_name(name, clause),
|
domain = super(Template, cls).search_rec_name(name, clause)
|
||||||
[('code',) + tuple(clause[1:])]]
|
if clause[1].startswith('!') or clause[1].startswith('not '):
|
||||||
|
bool_op = 'AND'
|
||||||
|
else:
|
||||||
|
bool_op = 'OR'
|
||||||
|
return [bool_op,
|
||||||
|
domain,
|
||||||
|
('code',) + tuple(clause[1:]),
|
||||||
|
]
|
||||||
|
|
||||||
def get_code(self, name):
|
def get_code(self, name):
|
||||||
if self.unique_variant:
|
if self.unique_variant:
|
||||||
|
|
Loading…
Reference in a new issue