Comment 0 for bug 557326

Revision history for this message
Numérigraphe (numerigraphe) wrote :

Answers for Question #106692 indicate that for the moment we can't do a "SELECT DISTINCT" using the ORM.
There are cases where this would be useful (like searching the order ids in order lines), so I propose we add a new parameter "distinct=False" to the search() method of th OSVs.
When set to True, it would return distinct tuples only.
It seems easy to add in osv using a SELECT DISTINCT statement.
It may be a bit more tricky in osv_memory, and it will run slower of course, and none sane will use it there I suppose, so we should just throw a "not implemented" exception I guess.
Lionel