select = [ids]
else:
select = ids
-
- # FIXME: find a better way to not push virtual ids in the cache
- # (leading to their prefetching and ultimately a type error when
- # postgres tries to convert '14-3489274297' to an integer)
- self.invalidate_cache(cr, uid, context=context)
-
select = map(lambda x: (x, calendar_id2real_id(x)), select)
result = []
real_data = super(calendar_event, self).read(cr, uid, [real_id for calendar_id, real_id in select], fields=fields2, context=context, load=load)
instance) for `self` in cache.
"""
# fetch the records of this model without field_name in their cache
- records = self
+ records = self._in_cache_without(field)
# by default, simply fetch field
fnames = {field.name}
'order': self._parent_order or self._order,
}
- empty = self.browse()
- prefetch = set()
- todo = set()
- for field in (self._fields[name] for name in field_names):
- prefetch.update(self._in_cache_without(field).ids)
- todo.update(self.env.todo.get(field, empty).ids)
- records = self.browse(prefetch - todo | set(self.ids))
-
result = []
- for sub_ids in cr.split_for_in_conditions(records.ids):
+ for sub_ids in cr.split_for_in_conditions(self.ids):
cr.execute(query, [tuple(sub_ids)] + rule_params)
result.extend(cr.dictfetchall())
# store failed values in cache for the records that could not be read
fetched = self.browse(ids)
- missing = records - fetched
+ missing = self - fetched
if missing:
- extras = fetched - records
+ extras = fetched - self
if extras:
raise AccessError(
_("Database fetch misses ids ({}) and has extra ids ({}), may be caused by a type incoherence in a previous request").format(