[FIX] test proxy recordset union / concatenation

Apparently I wrote this when I was a dumbshit and did not think that
Python sets are implemented completely separately from dicts
and *remain unordered*.

As a result, the simplistic set union would not properly conserve
record order, which it should.
This commit is contained in:
Xavier Morel 2021-02-26 09:43:58 +01:00
parent 2b64f7feb3
commit a541781ee0

View File

@ -1123,7 +1123,11 @@ class Model:
if not isinstance(other, Model) or self._model != other._model:
return NotImplemented
return Model(self._env, self._model, {*self._ids, *other._ids}, fields=self._fields)
return Model(
self._env, self._model,
self._ids + tuple(id_ for id_ in other.ids if id_ not in self._ids),
fields=self._fields
)
__add__ = __or__
def __and__(self, other):