Avoid search condition like ids in []
In the create purchase wizard, there are several usage of such clause with the active_ids but the length of active_ids could be very large. In such case, the clause could be too large for SQL query.
Indeed it is better to filter the request in Python and rely on the cache management of Tryton.