mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[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:
parent
3d33d0406e
commit
acaf605472
@ -1440,6 +1440,11 @@ class Model:
|
|||||||
def __setattr__(self, fieldname, value):
|
def __setattr__(self, fieldname, value):
|
||||||
self._env(self._model, 'write', self._ids, {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):
|
def __iter__(self):
|
||||||
return (
|
return (
|
||||||
Model(self._env, self._model, [i], fields=self._fields)
|
Model(self._env, self._model, [i], fields=self._fields)
|
||||||
|
Loading…
Reference in New Issue
Block a user