In timesheet.line, my employee field is a Many2One to company.employee

Hi,
In timesheet.line, the employee field is a Many2One to company.employee.

employee = fields.Many2One('company.employee', 'Employee', required=True,
    select=True, domain=[
        ('company', '=', Eval('company', -1)),
        ['OR',
            ('start_date', '=', None),
            ('start_date', '<=', Eval('date')),
            ],
        ['OR',
            ('end_date', '=', None),
            ('end_date', '>=', Eval('date')),
            ],
        ],
    depends=['company', 'date'],
    help="The employee who spends the time.")

When I search by a surname(I click on the Filter icon and type the word on employee field), for example “Clarke”, Tryton also returns employees whose displayed name does not contain “Clarke”, such as Mario X.

The employee field domain only filters by company and start/end dates.

Is this normal behavior for a Many2One search in Tryton?

PS: for other names it works normally , this behaviour just happen when I put last name of “xxxx Clarke” , even I have other employees , it show just Mario X in case I type last name “Clarke”.

I would like the search results to match only the employee/party name typed by the user.

Thank you.

This is because the record name search on employee is based on the record name search of party which includes also search on code, identifiers and contact mechanims.

But I think in such case it would make more sense to limit the employee record name search to only the name of the party.

Here is Search company and employee only by party name (#15095) · Issues · Tryton / Tryton · GitLab