[IMP] core: make exists determinist
[IMP] core: make exists determinist

When testing odoo, errors can occur an undeterministic way, wich can
lead to strange and unreproductible behaviour.  This also means that the
performance can change from one execution to another, making it quite
difficult to track performance variation on a global scope.

This commit makes the result of `exists()` deterministic in terms of
order.  The side effect is to keep record ids in the same order as the
original recordset, which may be useful.

closes odoo/odoo#47282

Signed-off-by: Raphael Collet (rco) <fcee45b878db1f337818c5c606c1542797080a40@openerp.com>
Co-authored-by: Raphael Collet <fcee45b878db1f337818c5c606c1542797080a40@odoo.com>

ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo