Remove starting wildcard when searching on codes and numbers
issue7347 review64541002
This commit is contained in:
1 parent
70a319b1c7
commit
5a032f3191
2 files changed
+7
-1
No files matched your search
@@ -1,3 +1,5 @@
|
||||
* Remove starting wildcard when searching on codes and numbers
|
||||
|
||||
Version 5.0.0 - 2018-10-01
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
* Remove support for Python 2.7
|
||||
|
||||
+5
-1
@@ -13,6 +13,7 @@ from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond import backend
|
||||
from trytond.config import config
|
||||
from trytond.tools import lstrip_wildcard
|
||||
from trytond.tools.multivalue import migrate_property
|
||||
from trytond.modules.company.model import (
|
||||
CompanyMultiValueMixin, CompanyValueMixin)
|
||||
@@ -309,8 +310,11 @@ class Product(
|
||||
bool_op = 'AND'
|
||||
else:
|
||||
bool_op = 'OR'
|
||||
code_value = clause[2]
|
||||
if clause[1].endswith('like'):
|
||||
code_value = lstrip_wildcard(clause[2])
|
||||
return [bool_op,
|
||||
('code',) + tuple(clause[1:]),
|
||||
('code', clause[1], code_value) + tuple(clause[3:]),
|
||||
('template.name',) + tuple(clause[1:]),
|
||||
]
|
||||
|
||||
|
||||
Reference in new issue
Block a user