[FIX] runbot_merge: implement __contains__ in test proxy model

`read_tracking_value` likely never worked correctly in both branches,
but worked in 15.0 because the failures to do anything useful happened
to end in the right case?
This commit is contained in:
Xavier Morel 2024-11-20 12:34:02 +01:00
parent 3d33d0406e
commit acaf605472

View File

@ -1440,6 +1440,11 @@ class Model:
def __setattr__(self, fieldname, value):
self._env(self._model, 'write', self._ids, {fieldname: value})
def __contains__(self, item: str | int) -> bool:
if isinstance(item, str):
return item in self._fields
return item in self.ids
def __iter__(self):
return (
Model(self._env, self._model, [i], fields=self._fields)