Improve search_rec_name methods
This commit is contained in:
parent
27ad86f927
commit
c552b190ac
32
shipment.py
32
shipment.py
|
@ -31,7 +31,13 @@ class ShipmentInReturn:
|
|||
|
||||
@classmethod
|
||||
def search_rec_name(cls, name, clause):
|
||||
return ['OR',
|
||||
domain = super(ShipmentInReturn, 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,
|
||||
('code',) + tuple(clause[1:]),
|
||||
('reference',) + tuple(clause[1:]),
|
||||
]
|
||||
|
@ -43,7 +49,13 @@ class ShipmentOut:
|
|||
|
||||
@classmethod
|
||||
def search_rec_name(cls, name, clause):
|
||||
return ['OR',
|
||||
domain = super(ShipmentOut, 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,
|
||||
('code',) + tuple(clause[1:]),
|
||||
('reference',) + tuple(clause[1:]),
|
||||
]
|
||||
|
@ -55,7 +67,13 @@ class ShipmentOutReturn:
|
|||
|
||||
@classmethod
|
||||
def search_rec_name(cls, name, clause):
|
||||
return ['OR',
|
||||
domain = super(ShipmentOutReturn, 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,
|
||||
('code',) + tuple(clause[1:]),
|
||||
('reference',) + tuple(clause[1:]),
|
||||
]
|
||||
|
@ -67,7 +85,13 @@ class ShipmentInternal:
|
|||
|
||||
@classmethod
|
||||
def search_rec_name(cls, name, clause):
|
||||
return ['OR',
|
||||
domain = super(ShipmentInternal, 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,
|
||||
('code',) + tuple(clause[1:]),
|
||||
('reference',) + tuple(clause[1:]),
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue