mirror of
https://gitlab.com/datalifeit/trytond-sale_product_customer
synced 2023-12-14 04:22:56 +01:00
Remove starting wildcard when searching on codes and numbers
issue7347 review64541002
This commit is contained in:
parent
7138ab57df
commit
364bc93d65
|
@ -5,6 +5,7 @@ from trytond.model import (fields, ModelSQL, ModelView, sequence_ordered,
|
|||
MatchMixin)
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.pyson import If, Eval, Bool
|
||||
from trytond.tools import lstrip_wildcard
|
||||
|
||||
|
||||
class ProductCustomer(sequence_ordered(), ModelSQL, ModelView, MatchMixin):
|
||||
|
@ -55,11 +56,14 @@ class ProductCustomer(sequence_ordered(), ModelSQL, ModelView, MatchMixin):
|
|||
bool_op = 'AND'
|
||||
else:
|
||||
bool_op = 'OR'
|
||||
code_value = clause[2]
|
||||
if clause[1].endswith('like'):
|
||||
code_value = lstrip_wildcard(clause[2])
|
||||
domain = [bool_op,
|
||||
('template',) + tuple(clause[1:]),
|
||||
('product',) + tuple(clause[1:]),
|
||||
('party',) + tuple(clause[1:]),
|
||||
('code',) + tuple(clause[1:]),
|
||||
('code', clause[1], code_value) + tuple(clause[3:]),
|
||||
('name',) + tuple(clause[1:]),
|
||||
]
|
||||
return domain
|
||||
|
|
Loading…
Reference in a new issue