Search clause for Many2One function field using ";" character
In the next example is a Many2One function field with a custom searcher. Source code: ``` assignee = fields.Function(fields.Many2One('party.party', 'Assignee'), 'get_assignee', searcher='search_assignee') @classmethod def get_assignee(cls): pass @classmethod def search_assignee(cls, name, clause): print(clause) return [('id', 'in', [])] ``` When searching in a tree view using the ; character, you observed different behavior based on the position of the function field in the search input. **Case 1:** function field in first position ``` Assignee: test2; Name: test ``` clause in searcher method is: ``` ['assignee.rec_name', 'in', ['test2']] ``` **Case 2:** function field in second position ``` Name: test; Assignee: test2 ``` clause in searcher method is: ``` ['assignee', 'ilike', '%test2%'] ``` Issue: When the function field (assignee) is the first position, the clause uses ['assignee.rec_name', 'in', ['test2']], indicating it's searching by the rec_name. When the function field is in the second position, it uses ['assignee', 'ilike', '%test2%'], which is a more standard search clause. The search clause behavior should be consistent, regardless of the position of the function field in the search input. Problem with the semicolon (;): It appears that the ; character is being replaced or parsed differently when it's used to separate multiple search conditions. This inconsistency is causing the function field to behave differently when placed in different positions. A the end, after search, the input search dissapered the semicolon (;): ``` Assignee: test2 Name: test ``` In case try to search without semicolon, the clause is: ``` ['assignee', 'ilike', '%test2%'] ```
issue