For special development, I need to add lastname to party_party.
It works well, except when I try to search for full name (name + lastname).
I added this code, and works when I search for name or lastname but no when I use both at same time.
For example,
John works fine
Doe works fine
John Doe doesn’t work
@classmethod
def search_rec_name(cls, name, clause):
_, operator, operand, *extra = clause
if operator.startswith('!') or operator.startswith('not '):
bool_op = 'AND'
else:
bool_op = 'OR'
code_value = operand
if operator.endswith('like') and is_full_text(operand):
code_value = lstrip_wildcard(operand)
return [bool_op,
('code', operator, code_value, *extra),
('identifiers.code', operator, code_value, *extra),
('name', operator, operand, *extra),
('lastname', operator, operand, *extra),
('contact_mechanisms.rec_name', operator, operand, *extra),
]
I will thank any help.